﻿'*******************************************************************
' Program: Data Center Visio Rack Tool
' Author: Albert E Edlund
' Date:
'
' Purpose:
'
'
' this class library has to remain in the object project so that we do not create
' a circular call from reporting and systems management
'
' Obtain an OID (Object IDentifier) from IANA. To participate in the SNMP arena, you need to 
' define your classes and events in a MIB file. First, The SNMP root node must be a unique number 
' (only ONE MIB/SNMP Private Enterprise number is permitted per organization). IANA: 
' http://www.iana.org/cgi-bin/enterprise.pl 
' 
' Create a MIB (Management Information Base) file (check out Appendix B for some useful and easy-to-use 
' MIB editors). Define classes and SNMP traps (events) that eventually will be exposed by the WMI Provider. 
' c:\windows\system32\wbem (after wmi/snmp support is installed)
' Compile the MIB file using the SMI2SMIR utility. This will generate a MOF file. 
' now put it into the wmi repository
' for the rfc1213 mib the file call format was first the file and then the list of embedded dependencies
'
' c:\windows\system32\wbem\mof
'
' Compile the MOF file using the mofcomp.exe compiler to check the MOF file syntax correctness. 
' 
' Create the vb classes and events with the Mgmtclassgen utility (refer to Appendix B). 
' Use the C# classes to create WMI provider. 
'
' c:\program files\microsoft sdks\windows\v6.1\bin\mgmtclassgen
'
' mgmtclassgen Win32_LogicalDisk /n root\cimv2 /l VB /p c:\disk.vb
' mgmtclassgen Win32_ComputerSystem /n root\cimv2 /l VB /p c:\computer.vb
' mgmtclassgen Win32_OperatingSystem /n root\cimv2 /l VB /p c:\OperatingSystem.vb
' mgmtclassgen Win32_Processor /n root\cimv2 /l VB /p c:\Processor.vb
' mgmtclassgen Win32_DiskPartition /n root\cimv2 /l VB /p c:\Partition.vb
' mgmtclassgen Win32_NetworkAdapter /n root\cimv2 /l VB /p c:\NetAdapt.vb
' mgmtclassgen Win32_NetworkAdapterConfiguration /n root\cimv2 /l VB /p c:\NetConfig.vb
' mgmtclassgen Win32_NTLogEvent /n root\cimv2 /l VB /p c:\NtLog.vb
'
'
' SNMP_RFC1213_MIB_icmp
' SNMP_RFC1213_MIB_ifTable
' SNMP_RFC1213_MIB_ipAddrTable
' SNMP_RFC1213_MIB_ipRouteTable
' SNMP_RFC1213_MIB_System

' mgmtclassgen SNMP_RFC1213_MIB_ipaddrtable /n root\snmp\smir /l VB /p c:\rfc1213.vb
'
'*******************************************************************

Imports System
Imports System.ComponentModel
Imports System.Management
Imports System.Management.Instrumentation
Imports System.Collections
Imports System.Globalization
Imports Microsoft.VisualBasic

Imports Microsoft.Practices.EnterpriseLibrary.Common
Imports Microsoft.Practices.EnterpriseLibrary.ExceptionHandling






Public Class WmiResults

    
#Region "WMI System CIMs"


    'Functions ShouldSerialize<PropertyName> are functions used by VS property browser to check if a particular property has to be serialized. These functions are added for all ValueType properties ( properties of type Int32, BOOL etc.. which cannot be set to null). These functions use Is<PropertyName>Null function. These functions are also used in the TypeConverter implementation for the properties to check for NULL value of property so that an empty value can be shown in Property browser in case of Drag and Drop in Visual studio.
    'Functions Is<PropertyName>Null() are used to check if a property is NULL.
    'Functions Reset<PropertyName> are added for Nullable Read/Write properties. These functions are used by VS designer in property browser to set a property to NULL.
    'Every property added to the class for WMI property has attributes set to define its behavior in Visual Studio designer and also to define a TypeConverter to be used.
    'Datetime conversion functions ToDateTime and ToDmtfDateTime are added to the class to convert DMTF datetime to System.DateTime and vice-versa.
    'An Early Bound class generated for the WMI class.Win32_ComputerSystem

    Public Class ComputerSystem
        Inherits System.ComponentModel.Component

#Region "begin"

        'Private property to hold the WMI namespace in which the class resides.
        Private Shared CreatedWmiNamespace As String = "root\cimv2"

        'Private property to hold the name of WMI class which created this class.
        Private Shared CreatedClassName As String = "Win32_ComputerSystem"

        'Private member variable to hold the ManagementScope which is used by the various methods.
        Private Shared statMgmtScope As System.Management.ManagementScope = Nothing

        Private PrivateSystemProperties As ManagementSystemProperties

        'Underlying lateBound WMI object.
        Private PrivateLateBoundObject As System.Management.ManagementObject

        'Member variable to store the 'automatic commit' behavior for the class.
        Private AutoCommitProp As Boolean

        'Private variable to hold the embedded property representing the instance.
        Private embeddedObj As System.Management.ManagementBaseObject

        'The current WMI object used
        Private curObj As System.Management.ManagementBaseObject

        'Flag to indicate if the instance is an embedded object.
        Private isEmbedded As Boolean

        'Below are different overloads of constructors to initialize an instance of the class with a WMI object.
        Public Sub New()
            MyBase.New()
            Me.InitializeObject(Nothing, Nothing, Nothing)
        End Sub

        Public Sub New(ByVal keyName As String)
            MyBase.New()
            Me.InitializeObject(Nothing, New System.Management.ManagementPath(ComputerSystem.ConstructPath(keyName)), Nothing)
        End Sub

        Public Sub New(ByVal mgmtScope As System.Management.ManagementScope, ByVal keyName As String)
            MyBase.New()
            Me.InitializeObject(CType(mgmtScope, System.Management.ManagementScope), New System.Management.ManagementPath(ComputerSystem.ConstructPath(keyName)), Nothing)
        End Sub

        Public Sub New(ByVal path As System.Management.ManagementPath, ByVal getOptions As System.Management.ObjectGetOptions)
            MyBase.New()
            Me.InitializeObject(Nothing, path, getOptions)
        End Sub

        Public Sub New(ByVal mgmtScope As System.Management.ManagementScope, ByVal path As System.Management.ManagementPath)
            MyBase.New()
            Me.InitializeObject(mgmtScope, path, Nothing)
        End Sub

        Public Sub New(ByVal path As System.Management.ManagementPath)
            MyBase.New()
            Me.InitializeObject(Nothing, path, Nothing)
        End Sub

        Public Sub New(ByVal mgmtScope As System.Management.ManagementScope, ByVal path As System.Management.ManagementPath, ByVal getOptions As System.Management.ObjectGetOptions)
            MyBase.New()
            Me.InitializeObject(mgmtScope, path, getOptions)
        End Sub

        Public Sub New(ByVal theObject As System.Management.ManagementObject)
            MyBase.New()
            Initialize()
            If (CheckIfProperClass(theObject) = True) Then
                PrivateLateBoundObject = theObject
                PrivateSystemProperties = New ManagementSystemProperties(PrivateLateBoundObject)
                curObj = PrivateLateBoundObject
            Else
                Throw New System.ArgumentException("Class name does not match.")
            End If
        End Sub

        Public Sub New(ByVal theObject As System.Management.ManagementBaseObject)
            MyBase.New()
            Initialize()
            If (CheckIfProperClass(theObject) = True) Then
                embeddedObj = theObject
                PrivateSystemProperties = New ManagementSystemProperties(theObject)
                curObj = embeddedObj
                isEmbedded = True
            Else
                Throw New System.ArgumentException("Class name does not match.")
            End If
        End Sub

        'Property returns the namespace of the WMI class.
        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property OriginatingNamespace() As String
            Get
                Return "root\cimv2"
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property ManagementClassName() As String
            Get
                Dim strRet As String = CreatedClassName
                If (Not (curObj) Is Nothing) Then
                    If (Not (curObj.ClassPath) Is Nothing) Then
                        strRet = CType(curObj("__CLASS"), String)
                        If ((strRet Is Nothing) _
                                    OrElse (strRet Is String.Empty)) Then
                            strRet = CreatedClassName
                        End If
                    End If
                End If
                Return strRet
            End Get
        End Property

        'Property pointing to an embedded object to get System properties of the WMI object.
        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property SystemProperties() As ManagementSystemProperties
            Get
                Return PrivateSystemProperties
            End Get
        End Property

        'Property returning the underlying lateBound object.
        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property LateBoundObject() As System.Management.ManagementBaseObject
            Get
                Return curObj
            End Get
        End Property

        'ManagementScope of the object.
        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public Property Scope() As System.Management.ManagementScope
            Get
                If (isEmbedded = False) Then
                    Return PrivateLateBoundObject.Scope
                Else
                    Return Nothing
                End If
            End Get
            Set(ByVal value As System.Management.ManagementScope)
                If (isEmbedded = False) Then
                    PrivateLateBoundObject.Scope = value
                End If
            End Set
        End Property

        'Property to show the commit behavior for the WMI object. If true, WMI object will be automatically saved after each property modification.(ie. Put() is called after modification of a property).
        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public Property AutoCommit() As Boolean
            Get
                Return AutoCommitProp
            End Get
            Set(ByVal value As Boolean)
                AutoCommitProp = value
            End Set
        End Property

        'The ManagementPath of the underlying WMI object.
        <Browsable(True)> _
        Public Property Path() As System.Management.ManagementPath
            Get
                If (isEmbedded = False) Then
                    Return PrivateLateBoundObject.Path
                Else
                    Return Nothing
                End If
            End Get
            Set(ByVal value As System.Management.ManagementPath)
                If (isEmbedded = False) Then
                    If (CheckIfProperClass(Nothing, value, Nothing) <> True) Then
                        Throw New System.ArgumentException("Class name does not match.")
                    End If
                    PrivateLateBoundObject.Path = value
                End If
            End Set
        End Property

        'Public static scope property which is used by the various methods.
        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public Shared Property StaticScope() As System.Management.ManagementScope
            Get
                Return statMgmtScope
            End Get
            Set(ByVal value As System.Management.ManagementScope)
                statMgmtScope = value
            End Set
        End Property


#End Region

#Region "attributes"



        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsAdminPasswordStatusNull() As Boolean
            Get
                If (curObj("AdminPasswordStatus") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The AdminPasswordStatus property identifies the system-wide hardware security set" & _
            "tings for Administrator Password Status."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property AdminPasswordStatus() As AdminPasswordStatusValues
            Get
                If (curObj("AdminPasswordStatus") Is Nothing) Then
                    Return CType(System.Convert.ToInt32(4), AdminPasswordStatusValues)
                End If
                Return CType(System.Convert.ToInt32(curObj("AdminPasswordStatus")), AdminPasswordStatusValues)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsAutomaticManagedPagefileNull() As Boolean
            Get
                If (curObj("AutomaticManagedPagefile") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The AutomaticManagedPagefile property determines whether the system managed pagef" & _
            "ile is enabled. This capability is notAvailable on windows server 2003,XP and lo" & _
            "wer versions." & Global.Microsoft.VisualBasic.ChrW(10) & "Values: TRUE or FALSE. If TRUE, the automatic managed pagefile is " & _
            "enabled."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public Property AutomaticManagedPagefile() As Boolean
            Get
                If (curObj("AutomaticManagedPagefile") Is Nothing) Then
                    Return System.Convert.ToBoolean(0)
                End If
                Return CType(curObj("AutomaticManagedPagefile"), Boolean)
            End Get
            Set(ByVal value As Boolean)
                curObj("AutomaticManagedPagefile") = value
                If ((isEmbedded = False) _
                            AndAlso (AutoCommitProp = True)) Then
                    PrivateLateBoundObject.Put()
                End If
            End Set
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsAutomaticResetBootOptionNull() As Boolean
            Get
                If (curObj("AutomaticResetBootOption") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The AutomaticResetBootOption property determines whether the automatic reset boot" & _
            " option is enabled, i.e. whether the machine will try to reboot after a system f" & _
            "ailure." & Global.Microsoft.VisualBasic.ChrW(10) & "Values: TRUE or FALSE. If TRUE, the automatic reset boot option is enabl" & _
            "ed."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public Property AutomaticResetBootOption() As Boolean
            Get
                If (curObj("AutomaticResetBootOption") Is Nothing) Then
                    Return System.Convert.ToBoolean(0)
                End If
                Return CType(curObj("AutomaticResetBootOption"), Boolean)
            End Get
            Set(ByVal value As Boolean)
                curObj("AutomaticResetBootOption") = value
                If ((isEmbedded = False) _
                            AndAlso (AutoCommitProp = True)) Then
                    PrivateLateBoundObject.Put()
                End If
            End Set
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsAutomaticResetCapabilityNull() As Boolean
            Get
                If (curObj("AutomaticResetCapability") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The AutomaticResetCapability property determines whether the auto reboot feature " & _
            "is available with this machine. This capability is available on Windows NT but n" & _
            "ot on Windows 95." & Global.Microsoft.VisualBasic.ChrW(10) & "Values: TRUE or FALSE. If TRUE, the automatic reset is enabled" & _
            "."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property AutomaticResetCapability() As Boolean
            Get
                If (curObj("AutomaticResetCapability") Is Nothing) Then
                    Return System.Convert.ToBoolean(0)
                End If
                Return CType(curObj("AutomaticResetCapability"), Boolean)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsBootOptionOnLimitNull() As Boolean
            Get
                If (curObj("BootOptionOnLimit") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("Boot Option on Limit. Identifies the system action to be taken when the Reset Lim" & _
            "it is reached."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property BootOptionOnLimit() As BootOptionOnLimitValues
            Get
                If (curObj("BootOptionOnLimit") Is Nothing) Then
                    Return CType(System.Convert.ToInt32(4), BootOptionOnLimitValues)
                End If
                Return CType(System.Convert.ToInt32(curObj("BootOptionOnLimit")), BootOptionOnLimitValues)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsBootOptionOnWatchDogNull() As Boolean
            Get
                If (curObj("BootOptionOnWatchDog") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The BootOptionOnWatchDog Property indicates the type of re-boot action to be take" & _
            "n after the time on the watchdog timer has elapsed."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property BootOptionOnWatchDog() As BootOptionOnWatchDogValues
            Get
                If (curObj("BootOptionOnWatchDog") Is Nothing) Then
                    Return CType(System.Convert.ToInt32(4), BootOptionOnWatchDogValues)
                End If
                Return CType(System.Convert.ToInt32(curObj("BootOptionOnWatchDog")), BootOptionOnWatchDogValues)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsBootROMSupportedNull() As Boolean
            Get
                If (curObj("BootROMSupported") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The BootROMSupported property determines whether a boot ROM is supported." & Global.Microsoft.VisualBasic.ChrW(10) & "Values " & _
            "are TRUE or FALSE. If BootROMSupported equals TRUE, then a boot ROM is supported" & _
            "."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property BootROMSupported() As Boolean
            Get
                If (curObj("BootROMSupported") Is Nothing) Then
                    Return System.Convert.ToBoolean(0)
                End If
                Return CType(curObj("BootROMSupported"), Boolean)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The BootupState property specifies how the system was started. Fail-safe boot (al" & _
            "so called SafeBoot) bypasses the user's startup files. " & Global.Microsoft.VisualBasic.ChrW(10) & "Constraints: Must have a" & _
            " value.")> _
        Public ReadOnly Property BootupState() As String
            Get
                Return CType(curObj("BootupState"), String)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The Caption property is a short textual description (one-line string) of the obje" & _
            "ct.")> _
        Public ReadOnly Property Caption() As String
            Get
                Return CType(curObj("Caption"), String)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsChassisBootupStateNull() As Boolean
            Get
                If (curObj("ChassisBootupState") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The ChassisBootupState property indicates the enclosure's bootup state."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property ChassisBootupState() As ChassisBootupStateValues
            Get
                If (curObj("ChassisBootupState") Is Nothing) Then
                    Return CType(System.Convert.ToInt32(0), ChassisBootupStateValues)
                End If
                Return CType(System.Convert.ToInt32(curObj("ChassisBootupState")), ChassisBootupStateValues)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The CreationClassName property indicates the name of the class or the subclass us" & _
            "ed in the creation of an instance. When used with the other key properties of th" & _
            "is class, this property allows all instances of this class and its subclasses to" & _
            " be uniquely identified.")> _
        Public ReadOnly Property CreationClassName() As String
            Get
                Return CType(curObj("CreationClassName"), String)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsCurrentTimeZoneNull() As Boolean
            Get
                If (curObj("CurrentTimeZone") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The CurrentTimeZone property  indicates the amount of time the unitary computer s" & _
            "ystem is offset from Coordinated Universal Time."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public Property CurrentTimeZone() As Short
            Get
                If (curObj("CurrentTimeZone") Is Nothing) Then
                    Return System.Convert.ToInt16(0)
                End If
                Return CType(curObj("CurrentTimeZone"), Short)
            End Get
            Set(ByVal value As Short)
                curObj("CurrentTimeZone") = value
                If ((isEmbedded = False) _
                            AndAlso (AutoCommitProp = True)) Then
                    PrivateLateBoundObject.Put()
                End If
            End Set
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsDaylightInEffectNull() As Boolean
            Get
                If (curObj("DaylightInEffect") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The DaylightInEffect property specifies if the daylight savings is in effect. " & Global.Microsoft.VisualBasic.ChrW(10) & "Va" & _
            "lues: TRUE or FALSE.  If TRUE, daylight savings is presently being observed.  In" & _
            " most cases this means that the current time is one hour earlier than the standa" & _
            "rd time."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property DaylightInEffect() As Boolean
            Get
                If (curObj("DaylightInEffect") Is Nothing) Then
                    Return System.Convert.ToBoolean(0)
                End If
                Return CType(curObj("DaylightInEffect"), Boolean)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The Description property provides a textual description of the object. ")> _
        Public ReadOnly Property Description() As String
            Get
                Return CType(curObj("Description"), String)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The DNSHostName property indicates the DNS host name of the local computer.")> _
        Public ReadOnly Property DNSHostName() As String
            Get
                Return CType(curObj("DNSHostName"), String)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The Domain property indicates the name of the domain to which the computer belong" & _
            "s.")> _
        Public ReadOnly Property Domain() As String
            Get
                Return CType(curObj("Domain"), String)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsDomainRoleNull() As Boolean
            Get
                If (curObj("DomainRole") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The DomainRole property indicates the role this computer plays within its assigne" & _
            "d domain-workgroup. The domain-workgroup is a collection of computers on the sam" & _
            "e network.  For example, the DomainRole property may show this computer is a ""Me" & _
            "mber Workstation"" (value of [1])."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property DomainRole() As DomainRoleValues
            Get
                If (curObj("DomainRole") Is Nothing) Then
                    Return CType(System.Convert.ToInt32(6), DomainRoleValues)
                End If
                Return CType(System.Convert.ToInt32(curObj("DomainRole")), DomainRoleValues)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsEnableDaylightSavingsTimeNull() As Boolean
            Get
                If (curObj("EnableDaylightSavingsTime") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The EnableDaylightSavingsTime property indicates whether Daylight Savings Time is" & _
            " recognized on this machine.  FALSE - time does not move an hour ahead or behind" & _
            " in the year.  NULL - the status of DST is unknown on this system"), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public Property EnableDaylightSavingsTime() As Boolean
            Get
                If (curObj("EnableDaylightSavingsTime") Is Nothing) Then
                    Return System.Convert.ToBoolean(0)
                End If
                Return CType(curObj("EnableDaylightSavingsTime"), Boolean)
            End Get
            Set(ByVal value As Boolean)
                curObj("EnableDaylightSavingsTime") = value
                If ((isEmbedded = False) _
                            AndAlso (AutoCommitProp = True)) Then
                    PrivateLateBoundObject.Put()
                End If
            End Set
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsFrontPanelResetStatusNull() As Boolean
            Get
                If (curObj("FrontPanelResetStatus") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The FrontPanelResetStatus property identifies the hardware security settings for " & _
            "the reset button on the machine."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property FrontPanelResetStatus() As FrontPanelResetStatusValues
            Get
                If (curObj("FrontPanelResetStatus") Is Nothing) Then
                    Return CType(System.Convert.ToInt32(4), FrontPanelResetStatusValues)
                End If
                Return CType(System.Convert.ToInt32(curObj("FrontPanelResetStatus")), FrontPanelResetStatusValues)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsInfraredSupportedNull() As Boolean
            Get
                If (curObj("InfraredSupported") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The InfraredSupported property determines whether an infrared (IR) port exists on" & _
            " the computer system." & Global.Microsoft.VisualBasic.ChrW(10) & "Values are TRUE or FALSE. If InfraredSupported equals TRUE" & _
            ", then an IR port exists."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property InfraredSupported() As Boolean
            Get
                If (curObj("InfraredSupported") Is Nothing) Then
                    Return System.Convert.ToBoolean(0)
                End If
                Return CType(curObj("InfraredSupported"), Boolean)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("This object contains the data needed to find either the initial load device (its " & _
            "key) or the boot service to request the operating system to start up. In additio" & _
            "n, the load parameters (ie, a pathname and parameters) may also be specified.")> _
        Public ReadOnly Property InitialLoadInfo() As String()
            Get
                Return CType(curObj("InitialLoadInfo"), String())
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsInstallDateNull() As Boolean
            Get
                If (curObj("InstallDate") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The InstallDate property is datetime value indicating when the object was install" & _
            "ed. A lack of a value does not indicate that the object is not installed."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property InstallDate() As Date
            Get
                If (Not (curObj("InstallDate")) Is Nothing) Then
                    Return ToDateTime(CType(curObj("InstallDate"), String))
                Else
                    Return Date.MinValue
                End If
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsKeyboardPasswordStatusNull() As Boolean
            Get
                If (curObj("KeyboardPasswordStatus") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The KeyboardPasswordStatus property identifies the system-wide hardware security " & _
            "settings for Keyboard Password Status."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property KeyboardPasswordStatus() As KeyboardPasswordStatusValues
            Get
                If (curObj("KeyboardPasswordStatus") Is Nothing) Then
                    Return CType(System.Convert.ToInt32(4), KeyboardPasswordStatusValues)
                End If
                Return CType(System.Convert.ToInt32(curObj("KeyboardPasswordStatus")), KeyboardPasswordStatusValues)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("This object contains the data identifying either the initial load device (its key" & _
            ") or the boot service that requested the last operating system load. In addition" & _
            ", the load parameters (ie, a pathname and parameters) may also be specified.")> _
        Public ReadOnly Property LastLoadInfo() As String
            Get
                Return CType(curObj("LastLoadInfo"), String)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The Manufacturer property indicates the name of the computer manufacturer." & Global.Microsoft.VisualBasic.ChrW(10) & "Exampl" & _
            "e: Acme")> _
        Public ReadOnly Property Manufacturer() As String
            Get
                Return CType(curObj("Manufacturer"), String)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The Model property indicates the product name of the computer given by the manufa" & _
            "cturer.")> _
        Public ReadOnly Property Model() As String
            Get
                Return CType(curObj("Model"), String)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The Name property defines the label by which the object is known. When subclassed" & _
            ", the Name property can be overridden to be a Key property.")> _
        Public ReadOnly Property Name() As String
            Get
                Return CType(curObj("Name"), String)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The CIM_ComputerSystem object and its derivatives are Top Level Objects of CIM. T" & _
            "hey provide the scope for numerous components. Having unique CIM_System keys is " & _
            "required. A heuristic is defined to create the CIM_ComputerSystem name to attemp" & _
            "t to always generate the same name, independent of discovery protocol. This prev" & _
            "ents inventory and management problems where the same asset or entity is discove" & _
            "red multiple times, but can not be resolved to a single object. Use of the heuri" & _
            "stic is optional, but recommended. " & Global.Microsoft.VisualBasic.ChrW(10) & Global.Microsoft.VisualBasic.ChrW(10) & " The NameFormat property identifies how the" & _
            " computer system name is generated, using a heuristic. The heuristic is outlined" & _
            ", in detail, in the CIM V2 Common Model specification. It assumes that the docum" & _
            "ented rules are traversed in order, to determine and assign a name. The NameForm" & _
            "at values list defines the precedence order for assigning the computer system na" & _
            "me. Several rules do map to the same Value. " & Global.Microsoft.VisualBasic.ChrW(10) & Global.Microsoft.VisualBasic.ChrW(10) & " Note that the CIM_ComputerSystem " & _
            "Name calculated using the heuristic is the system's key value. Other names can b" & _
            "e assigned and used for the CIM_ComputerSystem that better suit the business, us" & _
            "ing Aliases.")> _
        Public ReadOnly Property NameFormat() As String
            Get
                Return CType(curObj("NameFormat"), String)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsNetworkServerModeEnabledNull() As Boolean
            Get
                If (curObj("NetworkServerModeEnabled") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The NetworkServerModeEnabled property determines whether Network Server Mode is e" & _
            "nabled." & Global.Microsoft.VisualBasic.ChrW(10) & "Values: TRUE or FALSE.  If TRUE, Network Server Mode is enabled."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property NetworkServerModeEnabled() As Boolean
            Get
                If (curObj("NetworkServerModeEnabled") Is Nothing) Then
                    Return System.Convert.ToBoolean(0)
                End If
                Return CType(curObj("NetworkServerModeEnabled"), Boolean)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsNumberOfLogicalProcessorsNull() As Boolean
            Get
                If (curObj("NumberOfLogicalProcessors") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The NumberOfLogicalProcessors property indicates the number of logical processors" & _
            " currently available on the system."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property NumberOfLogicalProcessors() As UInteger
            Get
                If (curObj("NumberOfLogicalProcessors") Is Nothing) Then
                    Return System.Convert.ToUInt32(0)
                End If
                Return CType(curObj("NumberOfLogicalProcessors"), UInteger)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsNumberOfProcessorsNull() As Boolean
            Get
                If (curObj("NumberOfProcessors") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The NumberOfProcessors property indicates the number of physical processors curre" & _
            "ntly available on the system. This is the number of processors whose status is """ & _
            "enabled"" - versus simply the number of processors for the computer system. The f" & _
            "ormer can be determined by enumerating the number of processor instances associa" & _
            "ted with the computer system object, using the Win32_ComputerSystemProcessor ass" & _
            "ociation."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property NumberOfProcessors() As UInteger
            Get
                If (curObj("NumberOfProcessors") Is Nothing) Then
                    Return System.Convert.ToUInt32(0)
                End If
                Return CType(curObj("NumberOfProcessors"), UInteger)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The OEMLogoBitmap array holds the data for a bitmap created by the OEM.")> _
        Public ReadOnly Property OEMLogoBitmap() As Byte()
            Get
                Return CType(curObj("OEMLogoBitmap"), Byte())
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("This structure contains free form strings defined by the OEM. Examples of this ar" & _
            "e: Part Numbers for Reference Documents for the system, contact information for " & _
            "the manufacturer, etc.")> _
        Public ReadOnly Property OEMStringArray() As String()
            Get
                Return CType(curObj("OEMStringArray"), String())
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsPartOfDomainNull() As Boolean
            Get
                If (curObj("PartOfDomain") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The PartOfDomain property indicates whether the computer is part of a domain or w" & _
            "orkgroup.  If TRUE, the computer is part of a domain.  If FALSE, the computer is" & _
            " part of a workgroup.  If NULL, the computer is not part of a network group, or " & _
            "is unknown."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property PartOfDomain() As Boolean
            Get
                If (curObj("PartOfDomain") Is Nothing) Then
                    Return System.Convert.ToBoolean(0)
                End If
                Return CType(curObj("PartOfDomain"), Boolean)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsPauseAfterResetNull() As Boolean
            Get
                If (curObj("PauseAfterReset") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The PauseAfterReset property identifies the time delay before the reboot is initi" & _
            "ated.  It is used after a system power cycle, system reset (local or remote), an" & _
            "d automatic system reset.  A value of -1 indicates that the pause value is unkno" & _
            "wn"), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property PauseAfterReset() As Long
            Get
                If (curObj("PauseAfterReset") Is Nothing) Then
                    Return System.Convert.ToInt64(0)
                End If
                Return CType(curObj("PauseAfterReset"), Long)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsPCSystemTypeNull() As Boolean
            Get
                If (curObj("PCSystemType") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The PCSystemType property indicates the nature of the PC a user is working with l" & _
            "ike Laptop, Desktop, Tablet-PC etc. "), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property PCSystemType() As PCSystemTypeValues
            Get
                If (curObj("PCSystemType") Is Nothing) Then
                    Return CType(System.Convert.ToInt32(9), PCSystemTypeValues)
                End If
                Return CType(System.Convert.ToInt32(curObj("PCSystemType")), PCSystemTypeValues)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("Indicates the specific power-related capabilities of a computer system and its as" & _
            "sociated running operating system. The values, 0=""Unknown"", 1=""Not Supported"", a" & _
            "nd 2=""Disabled"" are self-explanatory. The value, 3=""Enabled"" indicates that the " & _
            "power management features are currently enabled but the exact feature set is unk" & _
            "nown or the information is unavailable. ""Power Saving Modes Entered Automaticall" & _
            "y"" (4) describes that a system can change its power state based on usage or othe" & _
            "r criteria. ""Power State Settable"" (5) indicates that the SetPowerState method i" & _
            "s supported. ""Power Cycling Supported"" (6) indicates that the SetPowerState meth" & _
            "od can be invoked with the PowerState parameter set to 5 (""Power Cycle""). ""Timed" & _
            " Power On Supported"" (7) indicates that the SetPowerState method can be invoked " & _
            "with the PowerState parameter set to 5 (""Power Cycle"") and the Time parameter se" & _
            "t to a specific date and time, or interval, for power-on.")> _
        Public ReadOnly Property PowerManagementCapabilities() As PowerManagementCapabilitiesValues()
            Get
                Dim arrEnumVals As System.Array = CType(curObj("PowerManagementCapabilities"), System.Array)
                Dim enumToRet((arrEnumVals.Length) - 1) As PowerManagementCapabilitiesValues
                Dim counter As Integer = 0
                counter = 0
                Do While (counter < arrEnumVals.Length)
                    enumToRet(counter) = CType(System.Convert.ToInt32(arrEnumVals.GetValue(counter)), PowerManagementCapabilitiesValues)
                    counter = (counter + 1)
                Loop
                Return enumToRet
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsPowerManagementSupportedNull() As Boolean
            Get
                If (curObj("PowerManagementSupported") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("Boolean indicating that the ComputerSystem, with its running OperatingSystem, sup" & _
            "ports power management. This boolean does not indicate that power management fea" & _
            "tures are currently enabled, or if enabled, what features are supported. Refer t" & _
            "o the PowerManagementCapabilities array for this information. If this boolean is" & _
            " false, the integer value 1 for the string, ""Not Supported"", should be the only " & _
            "entry in the PowerManagementCapabilities array."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property PowerManagementSupported() As Boolean
            Get
                If (curObj("PowerManagementSupported") Is Nothing) Then
                    Return System.Convert.ToBoolean(0)
                End If
                Return CType(curObj("PowerManagementSupported"), Boolean)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsPowerOnPasswordStatusNull() As Boolean
            Get
                If (curObj("PowerOnPasswordStatus") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The PowerOnPasswordStatus property identifies the system-wide hardware security s" & _
            "ettings for Power On Password Status."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property PowerOnPasswordStatus() As PowerOnPasswordStatusValues
            Get
                If (curObj("PowerOnPasswordStatus") Is Nothing) Then
                    Return CType(System.Convert.ToInt32(4), PowerOnPasswordStatusValues)
                End If
                Return CType(System.Convert.ToInt32(curObj("PowerOnPasswordStatus")), PowerOnPasswordStatusValues)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsPowerStateNull() As Boolean
            Get
                If (curObj("PowerState") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("Indicates the current power state of the computer system and its associated opera" & _
            "ting system. Regarding the power saving states, these are defined as follows: Va" & _
            "lue 4 (Unknown) indicates that the system is known to be in a power save mode, b" & _
            "ut its exact status in this mode is unknown; 2 (Low Power Mode) indicates that t" & _
            "he system is in a power save state but still functioning, and may exhibit degrad" & _
            "ed performance; 3 (Standby) describes that the system is not functioning but cou" & _
            "ld be brought to full power 'quickly'; and value 7 (Warning) indicates that the " & _
            "computerSystem is in a warning state, though also in a power save mode."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property PowerState() As PowerStateValues
            Get
                If (curObj("PowerState") Is Nothing) Then
                    Return CType(System.Convert.ToInt32(10), PowerStateValues)
                End If
                Return CType(System.Convert.ToInt32(curObj("PowerState")), PowerStateValues)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsPowerSupplyStateNull() As Boolean
            Get
                If (curObj("PowerSupplyState") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The PowerSupplyState identifies the state of the enclosure's power supply (or sup" & _
            "plies) when last booted."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property PowerSupplyState() As PowerSupplyStateValues
            Get
                If (curObj("PowerSupplyState") Is Nothing) Then
                    Return CType(System.Convert.ToInt32(0), PowerSupplyStateValues)
                End If
                Return CType(System.Convert.ToInt32(curObj("PowerSupplyState")), PowerSupplyStateValues)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("A string that provides information on how the primary system owner can be reached" & _
            " (e.g. phone number, email address, ...).")> _
        Public ReadOnly Property PrimaryOwnerContact() As String
            Get
                Return CType(curObj("PrimaryOwnerContact"), String)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The name of the primary system owner.")> _
        Public ReadOnly Property PrimaryOwnerName() As String
            Get
                Return CType(curObj("PrimaryOwnerName"), String)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsResetCapabilityNull() As Boolean
            Get
                If (curObj("ResetCapability") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("If enabled (value = 4), the unitary computer system can be reset via hardware (e." & _
            "g. the power and reset buttons). If disabled (value = 3), hardware reset is not " & _
            "allowed. In addition to Enabled and Disabled, other values for the property are " & _
            "also defined - ""Not Implemented"" (5), ""Other"" (1) and ""Unknown"" (2)."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property ResetCapability() As ResetCapabilityValues
            Get
                If (curObj("ResetCapability") Is Nothing) Then
                    Return CType(System.Convert.ToInt32(0), ResetCapabilityValues)
                End If
                Return CType(System.Convert.ToInt32(curObj("ResetCapability")), ResetCapabilityValues)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsResetCountNull() As Boolean
            Get
                If (curObj("ResetCount") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The ResetCount property indicates the number of automatic resets since the last i" & _
            "ntentional reset.  A value of -1 indicates that the count is unknown."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property ResetCount() As Short
            Get
                If (curObj("ResetCount") Is Nothing) Then
                    Return System.Convert.ToInt16(0)
                End If
                Return CType(curObj("ResetCount"), Short)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsResetLimitNull() As Boolean
            Get
                If (curObj("ResetLimit") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The ResetLimit property indicates the number of consecutive time the system reset" & _
            " will be attempted. A value of -1 indicates that the limit is unknown"), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property ResetLimit() As Short
            Get
                If (curObj("ResetLimit") Is Nothing) Then
                    Return System.Convert.ToInt16(0)
                End If
                Return CType(curObj("ResetLimit"), Short)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("An array (bag) of strings that specify the roles this System plays in the IT-envi" & _
            "ronment. Subclasses of System may override this property to define explicit Role" & _
            "s values. Alternately, a Working Group may describe the heuristics, conventions " & _
            "and guidelines for specifying Roles. For example, for an instance of a networkin" & _
            "g system, the Roles property might contain the string, 'Switch' or 'Bridge'.")> _
        Public Property Roles() As String()
            Get
                Return CType(curObj("Roles"), String())
            End Get
            Set(ByVal value As String())
                curObj("Roles") = value
                If ((isEmbedded = False) _
                            AndAlso (AutoCommitProp = True)) Then
                    PrivateLateBoundObject.Put()
                End If
            End Set
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The Status property is a string indicating the current status of the object. Vari" & _
            "ous operational and non-operational statuses can be defined. Operational statuse" & _
            "s are ""OK"", ""Degraded"" and ""Pred Fail"". ""Pred Fail"" indicates that an element ma" & _
            "y be functioning properly but predicting a failure in the near future. An exampl" & _
            "e is a SMART-enabled hard drive. Non-operational statuses can also be specified." & _
            " These are ""Error"", ""Starting"", ""Stopping"" and ""Service"". The latter, ""Service""," & _
            " could apply during mirror-resilvering of a disk, reload of a user permissions l" & _
            "ist, or other administrative work. Not all such work is on-line, yet the managed" & _
            " element is neither ""OK"" nor in one of the other states.")> _
        Public ReadOnly Property Status() As String
            Get
                Return CType(curObj("Status"), String)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The SupportContactDescription property is an array that indicates the support con" & _
            "tact information for the Win32 computer system.")> _
        Public ReadOnly Property SupportContactDescription() As String()
            Get
                Return CType(curObj("SupportContactDescription"), String())
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsSystemStartupDelayNull() As Boolean
            Get
                If (curObj("SystemStartupDelay") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The SystemStartupDelay property indicates the time to delay before starting the o" & _
            "perating system" & Global.Microsoft.VisualBasic.ChrW(10) & Global.Microsoft.VisualBasic.ChrW(10) & "Note:  The SE_SYSTEM_ENVIRONMENT privilege is required on IA64b" & _
            "it machines. This privilege is not required for 32bit systems."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public Property SystemStartupDelay() As UShort
            Get
                If (curObj("SystemStartupDelay") Is Nothing) Then
                    Return System.Convert.ToUInt16(0)
                End If
                Return CType(curObj("SystemStartupDelay"), UShort)
            End Get
            Set(ByVal value As UShort)
                curObj("SystemStartupDelay") = value
                If ((isEmbedded = False) _
                            AndAlso (AutoCommitProp = True)) Then
                    PrivateLateBoundObject.Put()
                End If
            End Set
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The SystemStartupOptions property array indicates the options for starting up the" & _
            " computer system. Note that this property is not writable on IA64 bit machines. " & _
            "" & Global.Microsoft.VisualBasic.ChrW(10) & "Constraints: Must have a value." & Global.Microsoft.VisualBasic.ChrW(10) & Global.Microsoft.VisualBasic.ChrW(10) & "Note:  The SE_SYSTEM_ENVIRONMENT privilege is " & _
            "required on IA64bit machines. This privilege is not required for other systems.")> _
        Public Property SystemStartupOptions() As String()
            Get
                Return CType(curObj("SystemStartupOptions"), String())
            End Get
            Set(ByVal value As String())
                curObj("SystemStartupOptions") = value
                If ((isEmbedded = False) _
                            AndAlso (AutoCommitProp = True)) Then
                    PrivateLateBoundObject.Put()
                End If
            End Set
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsSystemStartupSettingNull() As Boolean
            Get
                If (curObj("SystemStartupSetting") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The SystemStartupSetting property indicates the index of the default start profil" & _
            "e. This value is 'calculated' so that it usually returns zero (0) because at wri" & _
            "te-time, the profile string is physically moved to the top of the list. (This is" & _
            " how Windows NT determines which value is the default.)" & Global.Microsoft.VisualBasic.ChrW(10) & Global.Microsoft.VisualBasic.ChrW(10) & "Note:  The SE_SYSTEM_EN" & _
            "VIRONMENT privilege is required on IA64bit machines. This privilege is not requi" & _
            "red for 32bit systems."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public Property SystemStartupSetting() As Byte
            Get
                If (curObj("SystemStartupSetting") Is Nothing) Then
                    Return System.Convert.ToByte(0)
                End If
                Return CType(curObj("SystemStartupSetting"), Byte)
            End Get
            Set(ByVal value As Byte)
                curObj("SystemStartupSetting") = value
                If ((isEmbedded = False) _
                            AndAlso (AutoCommitProp = True)) Then
                    PrivateLateBoundObject.Put()
                End If
            End Set
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The SystemType property indicates the type of system running on the Win32 compute" & _
            "r." & Global.Microsoft.VisualBasic.ChrW(10) & "Constraints: Must have a value")> _
        Public ReadOnly Property SystemType() As String
            Get
                Return CType(curObj("SystemType"), String)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsThermalStateNull() As Boolean
            Get
                If (curObj("ThermalState") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The ThermalState property identifies the enclosure's thermal state when last boot" & _
            "ed."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property ThermalState() As ThermalStateValues
            Get
                If (curObj("ThermalState") Is Nothing) Then
                    Return CType(System.Convert.ToInt32(0), ThermalStateValues)
                End If
                Return CType(System.Convert.ToInt32(curObj("ThermalState")), ThermalStateValues)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsTotalPhysicalMemoryNull() As Boolean
            Get
                If (curObj("TotalPhysicalMemory") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The TotalPhysicalMemory property indicates the total size of physical memory." & Global.Microsoft.VisualBasic.ChrW(10) & "Exa" & _
            "mple: 67108864"), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property TotalPhysicalMemory() As ULong
            Get
                If (curObj("TotalPhysicalMemory") Is Nothing) Then
                    Return System.Convert.ToUInt64(0)
                End If
                Return CType(curObj("TotalPhysicalMemory"), ULong)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The UserName property indicates the name of the currently-logged-on user." & Global.Microsoft.VisualBasic.ChrW(10) & "Constra" & _
            "ints: Must have a value. " & Global.Microsoft.VisualBasic.ChrW(10) & "Example: johnsmith")> _
        Public ReadOnly Property UserName() As String
            Get
                Return CType(curObj("UserName"), String)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsWakeUpTypeNull() As Boolean
            Get
                If (curObj("WakeUpType") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The WakeUpType property indicates the event that caused the system to power up."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property WakeUpType() As WakeUpTypeValues
            Get
                If (curObj("WakeUpType") Is Nothing) Then
                    Return CType(System.Convert.ToInt32(9), WakeUpTypeValues)
                End If
                Return CType(System.Convert.ToInt32(curObj("WakeUpType")), WakeUpTypeValues)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The Workgroup property contains the name of the workgroup.  This value is only va" & _
            "lid if the PartOfDomain property is FALSE.")> _
        Public Property Workgroup() As String
            Get
                Return CType(curObj("Workgroup"), String)
            End Get
            Set(ByVal value As String)
                curObj("Workgroup") = value
                If ((isEmbedded = False) _
                            AndAlso (AutoCommitProp = True)) Then
                    PrivateLateBoundObject.Put()
                End If
            End Set
        End Property

#End Region

#Region "the rest"

        Private Overloads Function CheckIfProperClass(ByVal mgmtScope As System.Management.ManagementScope, ByVal path As System.Management.ManagementPath, ByVal OptionsParam As System.Management.ObjectGetOptions) As Boolean
            If ((Not (path) Is Nothing) _
                        AndAlso (String.Compare(path.ClassName, Me.ManagementClassName, True, System.Globalization.CultureInfo.InvariantCulture) = 0)) Then
                Return True
            Else
                Return CheckIfProperClass(New System.Management.ManagementObject(mgmtScope, path, OptionsParam))
            End If
        End Function

        Private Overloads Function CheckIfProperClass(ByVal theObj As System.Management.ManagementBaseObject) As Boolean
            If ((Not (theObj) Is Nothing) _
                        AndAlso (String.Compare(CType(theObj("__CLASS"), String), Me.ManagementClassName, True, System.Globalization.CultureInfo.InvariantCulture) = 0)) Then
                Return True
            Else
                Dim parentClasses As System.Array = CType(theObj("__DERIVATION"), System.Array)
                If (Not (parentClasses) Is Nothing) Then
                    Dim count As Integer = 0
                    count = 0
                    Do While (count < parentClasses.Length)
                        If (String.Compare(CType(parentClasses.GetValue(count), String), Me.ManagementClassName, True, System.Globalization.CultureInfo.InvariantCulture) = 0) Then
                            Return True
                        End If
                        count = (count + 1)
                    Loop
                End If
            End If
            Return False
        End Function

        Private Function ShouldSerializeAdminPasswordStatus() As Boolean
            If (Me.IsAdminPasswordStatusNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeAutomaticManagedPagefile() As Boolean
            If (Me.IsAutomaticManagedPagefileNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Sub ResetAutomaticManagedPagefile()
            curObj("AutomaticManagedPagefile") = Nothing
            If ((isEmbedded = False) _
                        AndAlso (AutoCommitProp = True)) Then
                PrivateLateBoundObject.Put()
            End If
        End Sub

        Private Function ShouldSerializeAutomaticResetBootOption() As Boolean
            If (Me.IsAutomaticResetBootOptionNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Sub ResetAutomaticResetBootOption()
            curObj("AutomaticResetBootOption") = Nothing
            If ((isEmbedded = False) _
                        AndAlso (AutoCommitProp = True)) Then
                PrivateLateBoundObject.Put()
            End If
        End Sub

        Private Function ShouldSerializeAutomaticResetCapability() As Boolean
            If (Me.IsAutomaticResetCapabilityNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeBootOptionOnLimit() As Boolean
            If (Me.IsBootOptionOnLimitNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeBootOptionOnWatchDog() As Boolean
            If (Me.IsBootOptionOnWatchDogNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeBootROMSupported() As Boolean
            If (Me.IsBootROMSupportedNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeChassisBootupState() As Boolean
            If (Me.IsChassisBootupStateNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeCurrentTimeZone() As Boolean
            If (Me.IsCurrentTimeZoneNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Sub ResetCurrentTimeZone()
            curObj("CurrentTimeZone") = Nothing
            If ((isEmbedded = False) _
                        AndAlso (AutoCommitProp = True)) Then
                PrivateLateBoundObject.Put()
            End If
        End Sub

        Private Function ShouldSerializeDaylightInEffect() As Boolean
            If (Me.IsDaylightInEffectNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeDomainRole() As Boolean
            If (Me.IsDomainRoleNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeEnableDaylightSavingsTime() As Boolean
            If (Me.IsEnableDaylightSavingsTimeNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Sub ResetEnableDaylightSavingsTime()
            curObj("EnableDaylightSavingsTime") = Nothing
            If ((isEmbedded = False) _
                        AndAlso (AutoCommitProp = True)) Then
                PrivateLateBoundObject.Put()
            End If
        End Sub

        Private Function ShouldSerializeFrontPanelResetStatus() As Boolean
            If (Me.IsFrontPanelResetStatusNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeInfraredSupported() As Boolean
            If (Me.IsInfraredSupportedNull = False) Then
                Return True
            End If
            Return False
        End Function

        'Converts a given datetime in DMTF format to System.DateTime object.
        Shared Function ToDateTime(ByVal dmtfDate As String) As Date
            Dim initializer As Date = Date.MinValue
            Dim year As Integer = initializer.Year
            Dim month As Integer = initializer.Month
            Dim day As Integer = initializer.Day
            Dim hour As Integer = initializer.Hour
            Dim minute As Integer = initializer.Minute
            Dim second As Integer = initializer.Second
            Dim ticks As Long = 0
            Dim dmtf As String = dmtfDate
            Dim datetime As Date = Date.MinValue
            Dim tempString As String = String.Empty
            If (dmtf Is Nothing) Then
                Throw New System.ArgumentOutOfRangeException
            End If
            If (dmtf.Length = 0) Then
                Throw New System.ArgumentOutOfRangeException
            End If
            If (dmtf.Length <> 25) Then
                Throw New System.ArgumentOutOfRangeException
            End If
            Try
                tempString = dmtf.Substring(0, 4)
                If ("****" <> tempString) Then
                    year = Integer.Parse(tempString)
                End If
                tempString = dmtf.Substring(4, 2)
                If ("**" <> tempString) Then
                    month = Integer.Parse(tempString)
                End If
                tempString = dmtf.Substring(6, 2)
                If ("**" <> tempString) Then
                    day = Integer.Parse(tempString)
                End If
                tempString = dmtf.Substring(8, 2)
                If ("**" <> tempString) Then
                    hour = Integer.Parse(tempString)
                End If
                tempString = dmtf.Substring(10, 2)
                If ("**" <> tempString) Then
                    minute = Integer.Parse(tempString)
                End If
                tempString = dmtf.Substring(12, 2)
                If ("**" <> tempString) Then
                    second = Integer.Parse(tempString)
                End If
                tempString = dmtf.Substring(15, 6)
                If ("******" <> tempString) Then
                    ticks = (Long.Parse(tempString) * CType((System.TimeSpan.TicksPerMillisecond / 1000), Long))
                End If
                If ((((((((year < 0) _
                            OrElse (month < 0)) _
                            OrElse (day < 0)) _
                            OrElse (hour < 0)) _
                            OrElse (minute < 0)) _
                            OrElse (minute < 0)) _
                            OrElse (second < 0)) _
                            OrElse (ticks < 0)) Then
                    Throw New System.ArgumentOutOfRangeException
                End If
            Catch e As System.Exception
                Throw New System.ArgumentOutOfRangeException(Nothing, e.Message)
            End Try
            datetime = New Date(year, month, day, hour, minute, second, 0)
            datetime = datetime.AddTicks(ticks)
            Dim tickOffset As System.TimeSpan = System.TimeZone.CurrentTimeZone.GetUtcOffset(datetime)
            Dim UTCOffset As Integer = 0
            Dim OffsetToBeAdjusted As Integer = 0
            Dim OffsetMins As Long = CType((tickOffset.Ticks / System.TimeSpan.TicksPerMinute), Long)
            tempString = dmtf.Substring(22, 3)
            If (tempString <> "******") Then
                tempString = dmtf.Substring(21, 4)
                Try
                    UTCOffset = Integer.Parse(tempString)
                Catch e As System.Exception
                    Throw New System.ArgumentOutOfRangeException(Nothing, e.Message)
                End Try
                OffsetToBeAdjusted = CType((OffsetMins - UTCOffset), Integer)
                datetime = datetime.AddMinutes(CType(OffsetToBeAdjusted, Double))
            End If
            Return datetime
        End Function

        'Converts a given System.DateTime object to DMTF datetime format.
        Shared Function ToDmtfDateTime(ByVal [date] As Date) As String
            Dim utcString As String = String.Empty
            Dim tickOffset As System.TimeSpan = System.TimeZone.CurrentTimeZone.GetUtcOffset([date])
            Dim OffsetMins As Long = CType((tickOffset.Ticks / System.TimeSpan.TicksPerMinute), Long)
            If (System.Math.Abs(OffsetMins) > 999) Then
                [date] = [date].ToUniversalTime
                utcString = "+000"
            Else
                If (tickOffset.Ticks >= 0) Then
                    utcString = String.Concat("+", CType((tickOffset.Ticks / System.TimeSpan.TicksPerMinute), System.Int64).ToString.PadLeft(3, Global.Microsoft.VisualBasic.ChrW(48)))
                Else
                    Dim strTemp As String = CType(OffsetMins, System.Int64).ToString
                    utcString = String.Concat("-", strTemp.Substring(1, (strTemp.Length - 1)).PadLeft(3, Global.Microsoft.VisualBasic.ChrW(48)))
                End If
            End If
            Dim dmtfDateTime As String = CType([date].Year, System.Int32).ToString.PadLeft(4, Global.Microsoft.VisualBasic.ChrW(48))
            dmtfDateTime = String.Concat(dmtfDateTime, CType([date].Month, System.Int32).ToString.PadLeft(2, Global.Microsoft.VisualBasic.ChrW(48)))
            dmtfDateTime = String.Concat(dmtfDateTime, CType([date].Day, System.Int32).ToString.PadLeft(2, Global.Microsoft.VisualBasic.ChrW(48)))
            dmtfDateTime = String.Concat(dmtfDateTime, CType([date].Hour, System.Int32).ToString.PadLeft(2, Global.Microsoft.VisualBasic.ChrW(48)))
            dmtfDateTime = String.Concat(dmtfDateTime, CType([date].Minute, System.Int32).ToString.PadLeft(2, Global.Microsoft.VisualBasic.ChrW(48)))
            dmtfDateTime = String.Concat(dmtfDateTime, CType([date].Second, System.Int32).ToString.PadLeft(2, Global.Microsoft.VisualBasic.ChrW(48)))
            dmtfDateTime = String.Concat(dmtfDateTime, ".")
            Dim dtTemp As Date = New Date([date].Year, [date].Month, [date].Day, [date].Hour, [date].Minute, [date].Second, 0)
            Dim microsec As Long = CType(((([date].Ticks - dtTemp.Ticks) _
                        * 1000) _
                        / System.TimeSpan.TicksPerMillisecond), Long)
            Dim strMicrosec As String = CType(microsec, System.Int64).ToString
            If (strMicrosec.Length > 6) Then
                strMicrosec = strMicrosec.Substring(0, 6)
            End If
            dmtfDateTime = String.Concat(dmtfDateTime, strMicrosec.PadLeft(6, Global.Microsoft.VisualBasic.ChrW(48)))
            dmtfDateTime = String.Concat(dmtfDateTime, utcString)
            Return dmtfDateTime
        End Function

        Private Function ShouldSerializeInstallDate() As Boolean
            If (Me.IsInstallDateNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeKeyboardPasswordStatus() As Boolean
            If (Me.IsKeyboardPasswordStatusNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeNetworkServerModeEnabled() As Boolean
            If (Me.IsNetworkServerModeEnabledNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeNumberOfLogicalProcessors() As Boolean
            If (Me.IsNumberOfLogicalProcessorsNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeNumberOfProcessors() As Boolean
            If (Me.IsNumberOfProcessorsNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializePartOfDomain() As Boolean
            If (Me.IsPartOfDomainNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializePauseAfterReset() As Boolean
            If (Me.IsPauseAfterResetNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializePCSystemType() As Boolean
            If (Me.IsPCSystemTypeNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializePowerManagementSupported() As Boolean
            If (Me.IsPowerManagementSupportedNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializePowerOnPasswordStatus() As Boolean
            If (Me.IsPowerOnPasswordStatusNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializePowerState() As Boolean
            If (Me.IsPowerStateNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializePowerSupplyState() As Boolean
            If (Me.IsPowerSupplyStateNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeResetCapability() As Boolean
            If (Me.IsResetCapabilityNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeResetCount() As Boolean
            If (Me.IsResetCountNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeResetLimit() As Boolean
            If (Me.IsResetLimitNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Sub ResetRoles()
            curObj("Roles") = Nothing
            If ((isEmbedded = False) _
                        AndAlso (AutoCommitProp = True)) Then
                PrivateLateBoundObject.Put()
            End If
        End Sub

        Private Function ShouldSerializeSystemStartupDelay() As Boolean
            If (Me.IsSystemStartupDelayNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Sub ResetSystemStartupDelay()
            curObj("SystemStartupDelay") = Nothing
            If ((isEmbedded = False) _
                        AndAlso (AutoCommitProp = True)) Then
                PrivateLateBoundObject.Put()
            End If
        End Sub

        Private Sub ResetSystemStartupOptions()
            curObj("SystemStartupOptions") = Nothing
            If ((isEmbedded = False) _
                        AndAlso (AutoCommitProp = True)) Then
                PrivateLateBoundObject.Put()
            End If
        End Sub

        Private Function ShouldSerializeSystemStartupSetting() As Boolean
            If (Me.IsSystemStartupSettingNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Sub ResetSystemStartupSetting()
            curObj("SystemStartupSetting") = Nothing
            If ((isEmbedded = False) _
                        AndAlso (AutoCommitProp = True)) Then
                PrivateLateBoundObject.Put()
            End If
        End Sub

        Private Function ShouldSerializeThermalState() As Boolean
            If (Me.IsThermalStateNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeTotalPhysicalMemory() As Boolean
            If (Me.IsTotalPhysicalMemoryNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeWakeUpType() As Boolean
            If (Me.IsWakeUpTypeNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Sub ResetWorkgroup()
            curObj("Workgroup") = Nothing
            If ((isEmbedded = False) _
                        AndAlso (AutoCommitProp = True)) Then
                PrivateLateBoundObject.Put()
            End If
        End Sub

        <Browsable(True)> _
        Public Overloads Sub CommitObject()
            If (isEmbedded = False) Then
                PrivateLateBoundObject.Put()
            End If
        End Sub

        <Browsable(True)> _
        Public Overloads Sub CommitObject(ByVal putOptions As System.Management.PutOptions)
            If (isEmbedded = False) Then
                PrivateLateBoundObject.Put(putOptions)
            End If
        End Sub

        Private Sub Initialize()
            AutoCommitProp = True
            isEmbedded = False
        End Sub

        Private Shared Function ConstructPath(ByVal keyName As String) As String
            Dim strPath As String = "root\cimv2:Win32_ComputerSystem"
            strPath = String.Concat(strPath, String.Concat(".Name=", String.Concat("""", String.Concat(keyName, """"))))
            Return strPath
        End Function

        Private Sub InitializeObject(ByVal mgmtScope As System.Management.ManagementScope, ByVal path As System.Management.ManagementPath, ByVal getOptions As System.Management.ObjectGetOptions)
            Initialize()
            If (Not (path) Is Nothing) Then
                If (CheckIfProperClass(mgmtScope, path, getOptions) <> True) Then
                    Throw New System.ArgumentException("Class name does not match.")
                End If
            End If
            PrivateLateBoundObject = New System.Management.ManagementObject(mgmtScope, path, getOptions)
            PrivateSystemProperties = New ManagementSystemProperties(PrivateLateBoundObject)
            curObj = PrivateLateBoundObject
        End Sub

        'Different overloads of GetInstances() help in enumerating instances of the WMI class.
        Public Overloads Shared Function GetInstances() As ComputerSystemCollection
            Return GetInstances(Nothing, Nothing, Nothing)
        End Function

        Public Overloads Shared Function GetInstances(ByVal condition As String) As ComputerSystemCollection
            Return GetInstances(Nothing, condition, Nothing)
        End Function

        Public Overloads Shared Function GetInstances(ByVal selectedProperties() As System.String) As ComputerSystemCollection
            Return GetInstances(Nothing, Nothing, selectedProperties)
        End Function

        Public Overloads Shared Function GetInstances(ByVal condition As String, ByVal selectedProperties() As System.String) As ComputerSystemCollection
            Return GetInstances(Nothing, condition, selectedProperties)
        End Function

        Public Overloads Shared Function GetInstances(ByVal mgmtScope As System.Management.ManagementScope, ByVal enumOptions As System.Management.EnumerationOptions) As ComputerSystemCollection
            If (mgmtScope Is Nothing) Then
                If (statMgmtScope Is Nothing) Then
                    mgmtScope = New System.Management.ManagementScope
                    mgmtScope.Path.NamespacePath = "root\cimv2"
                Else
                    mgmtScope = statMgmtScope
                End If
            End If
            Dim pathObj As System.Management.ManagementPath = New System.Management.ManagementPath
            pathObj.ClassName = "Win32_ComputerSystem"
            pathObj.NamespacePath = "root\cimv2"
            Dim clsObject As System.Management.ManagementClass = New System.Management.ManagementClass(mgmtScope, pathObj, Nothing)
            If (enumOptions Is Nothing) Then
                enumOptions = New System.Management.EnumerationOptions
                enumOptions.EnsureLocatable = True
            End If
            Return New ComputerSystemCollection(clsObject.GetInstances(enumOptions))
        End Function

        Public Overloads Shared Function GetInstances(ByVal mgmtScope As System.Management.ManagementScope, ByVal condition As String) As ComputerSystemCollection
            Return GetInstances(mgmtScope, condition, Nothing)
        End Function

        Public Overloads Shared Function GetInstances(ByVal mgmtScope As System.Management.ManagementScope, ByVal selectedProperties() As System.String) As ComputerSystemCollection
            Return GetInstances(mgmtScope, Nothing, selectedProperties)
        End Function

        Public Overloads Shared Function GetInstances(ByVal mgmtScope As System.Management.ManagementScope, ByVal condition As String, ByVal selectedProperties() As System.String) As ComputerSystemCollection
            If (mgmtScope Is Nothing) Then
                If (statMgmtScope Is Nothing) Then
                    mgmtScope = New System.Management.ManagementScope
                    mgmtScope.Path.NamespacePath = "root\cimv2"
                Else
                    mgmtScope = statMgmtScope
                End If
            End If
            Dim ObjectSearcher As System.Management.ManagementObjectSearcher = New System.Management.ManagementObjectSearcher(mgmtScope, New SelectQuery("Win32_ComputerSystem", condition, selectedProperties))
            Dim enumOptions As System.Management.EnumerationOptions = New System.Management.EnumerationOptions
            enumOptions.EnsureLocatable = True
            ObjectSearcher.Options = enumOptions
            Return New ComputerSystemCollection(ObjectSearcher.Get)
        End Function

        <Browsable(True)> _
        Public Shared Function CreateInstance() As ComputerSystem
            Dim mgmtScope As System.Management.ManagementScope = Nothing
            If (statMgmtScope Is Nothing) Then
                mgmtScope = New System.Management.ManagementScope
                mgmtScope.Path.NamespacePath = CreatedWmiNamespace
            Else
                mgmtScope = statMgmtScope
            End If
            Dim mgmtPath As System.Management.ManagementPath = New System.Management.ManagementPath(CreatedClassName)
            Dim tmpMgmtClass As System.Management.ManagementClass = New System.Management.ManagementClass(mgmtScope, mgmtPath, Nothing)
            Return New ComputerSystem(tmpMgmtClass.CreateInstance)
        End Function

        <Browsable(True)> _
        Public Sub Delete()
            PrivateLateBoundObject.Delete()
        End Sub

        Public Function JoinDomainOrWorkgroup(ByVal AccountOU As String, ByVal FJoinOptions As UInteger, ByVal Name As String, ByVal Password As String, ByVal UserName As String) As UInteger
            If (isEmbedded = False) Then
                Dim inParams As System.Management.ManagementBaseObject = Nothing
                inParams = PrivateLateBoundObject.GetMethodParameters("JoinDomainOrWorkgroup")
                inParams("AccountOU") = CType(AccountOU, System.String)
                inParams("FJoinOptions") = CType(FJoinOptions, System.UInt32)
                inParams("Name") = CType(Name, System.String)
                inParams("Password") = CType(Password, System.String)
                inParams("UserName") = CType(UserName, System.String)
                Dim outParams As System.Management.ManagementBaseObject = PrivateLateBoundObject.InvokeMethod("JoinDomainOrWorkgroup", inParams, Nothing)
                Return System.Convert.ToUInt32(outParams.Properties("ReturnValue").Value)
            Else
                Return System.Convert.ToUInt32(0)
            End If
        End Function

        Public Function Rename(ByVal Name As String, ByVal Password As String, ByVal UserName As String) As UInteger
            If (isEmbedded = False) Then
                Dim inParams As System.Management.ManagementBaseObject = Nothing
                inParams = PrivateLateBoundObject.GetMethodParameters("Rename")
                inParams("Name") = CType(Name, System.String)
                inParams("Password") = CType(Password, System.String)
                inParams("UserName") = CType(UserName, System.String)
                Dim outParams As System.Management.ManagementBaseObject = PrivateLateBoundObject.InvokeMethod("Rename", inParams, Nothing)
                Return System.Convert.ToUInt32(outParams.Properties("ReturnValue").Value)
            Else
                Return System.Convert.ToUInt32(0)
            End If
        End Function

        Public Function SetPowerState(ByVal PowerState As UShort, ByVal Time As Date) As UInteger
            If (isEmbedded = False) Then
                Dim inParams As System.Management.ManagementBaseObject = Nothing
                inParams = PrivateLateBoundObject.GetMethodParameters("SetPowerState")
                inParams("PowerState") = CType(PowerState, System.UInt16)
                inParams("Time") = ToDmtfDateTime(CType(Time, Date))
                Dim outParams As System.Management.ManagementBaseObject = PrivateLateBoundObject.InvokeMethod("SetPowerState", inParams, Nothing)
                Return System.Convert.ToUInt32(outParams.Properties("ReturnValue").Value)
            Else
                Return System.Convert.ToUInt32(0)
            End If
        End Function

        Public Function UnjoinDomainOrWorkgroup(ByVal FUnjoinOptions As UInteger, ByVal Password As String, ByVal UserName As String) As UInteger
            If (isEmbedded = False) Then
                Dim inParams As System.Management.ManagementBaseObject = Nothing
                inParams = PrivateLateBoundObject.GetMethodParameters("UnjoinDomainOrWorkgroup")
                inParams("FUnjoinOptions") = CType(FUnjoinOptions, System.UInt32)
                inParams("Password") = CType(Password, System.String)
                inParams("UserName") = CType(UserName, System.String)
                Dim outParams As System.Management.ManagementBaseObject = PrivateLateBoundObject.InvokeMethod("UnjoinDomainOrWorkgroup", inParams, Nothing)
                Return System.Convert.ToUInt32(outParams.Properties("ReturnValue").Value)
            Else
                Return System.Convert.ToUInt32(0)
            End If
        End Function

        Public Enum AdminPasswordStatusValues

            Disabled = 0

            Enabled = 1

            Not_Implemented = 2

            Unknown0 = 3

            NULL_ENUM_VALUE = 4
        End Enum

        Public Enum BootOptionOnLimitValues

            Reserved = 0

            Operating_system = 1

            System_utilities = 2

            Do_not_reboot = 3

            NULL_ENUM_VALUE = 4
        End Enum

        Public Enum BootOptionOnWatchDogValues

            Reserved = 0

            Operating_system = 1

            System_utilities = 2

            Do_not_reboot = 3

            NULL_ENUM_VALUE = 4
        End Enum

        Public Enum ChassisBootupStateValues

            Other0 = 1

            Unknown0 = 2

            Safe = 3

            Warning = 4

            Critical = 5

            Non_recoverable = 6

            NULL_ENUM_VALUE = 0
        End Enum

        Public Enum DomainRoleValues

            Standalone_Workstation = 0

            Member_Workstation = 1

            Standalone_Server = 2

            Member_Server = 3

            Backup_Domain_Controller = 4

            Primary_Domain_Controller = 5

            NULL_ENUM_VALUE = 6
        End Enum

        Public Enum FrontPanelResetStatusValues

            Disabled = 0

            Enabled = 1

            Not_Implemented = 2

            Unknown0 = 3

            NULL_ENUM_VALUE = 4
        End Enum

        Public Enum KeyboardPasswordStatusValues

            Disabled = 0

            Enabled = 1

            Not_Implemented = 2

            Unknown0 = 3

            NULL_ENUM_VALUE = 4
        End Enum

        Public Enum PCSystemTypeValues

            Unspecified = 0

            Desktop = 1

            Mobile = 2

            Workstation = 3

            Enterprise_Server = 4

            SOHO_Server = 5

            Appliance_PC = 6

            Performance_Server = 7

            Maximum = 8

            NULL_ENUM_VALUE = 9
        End Enum

        Public Enum PowerManagementCapabilitiesValues

            Unknown0 = 0

            Not_Supported = 1

            Disabled = 2

            Enabled = 3

            Power_Saving_Modes_Entered_Automatically = 4

            Power_State_Settable = 5

            Power_Cycling_Supported = 6

            Timed_Power_On_Supported = 7

            NULL_ENUM_VALUE = 8
        End Enum

        Public Enum PowerOnPasswordStatusValues

            Disabled = 0

            Enabled = 1

            Not_Implemented = 2

            Unknown0 = 3

            NULL_ENUM_VALUE = 4
        End Enum

        Public Enum PowerStateValues

            Unknown0 = 0

            Full_Power = 1

            Power_Save_Low_Power_Mode = 2

            Power_Save_Standby = 3

            Power_Save_Unknown = 4

            Power_Cycle = 5

            Power_Off = 6

            Power_Save_Warning = 7

            Power_Save_Hibernate = 8

            Power_Save_Soft_Off = 9

            NULL_ENUM_VALUE = 10
        End Enum

        Public Enum PowerSupplyStateValues

            Other0 = 1

            Unknown0 = 2

            Safe = 3

            Warning = 4

            Critical = 5

            Non_recoverable = 6

            NULL_ENUM_VALUE = 0
        End Enum

        Public Enum ResetCapabilityValues

            Other0 = 1

            Unknown0 = 2

            Disabled = 3

            Enabled = 4

            Not_Implemented = 5

            NULL_ENUM_VALUE = 0
        End Enum

        Public Enum ThermalStateValues

            Other0 = 1

            Unknown0 = 2

            Safe = 3

            Warning = 4

            Critical = 5

            Non_recoverable = 6

            NULL_ENUM_VALUE = 0
        End Enum

        Public Enum WakeUpTypeValues

            Reserved = 0

            Other0 = 1

            Unknown0 = 2

            APM_Timer = 3

            Modem_Ring = 4

            LAN_Remote = 5

            Power_Switch = 6

            PCI_PME_ = 7

            AC_Power_Restored = 8

            NULL_ENUM_VALUE = 9
        End Enum

        'Enumerator implementation for enumerating instances of the class.
        Public Class ComputerSystemCollection
            Inherits Object
            Implements ICollection

            Private privColObj As ManagementObjectCollection

            Public Sub New(ByVal objCollection As ManagementObjectCollection)
                MyBase.New()
                privColObj = objCollection
            End Sub

            Public Overridable ReadOnly Property Count() As Integer Implements System.Collections.ICollection.Count
                Get
                    Return privColObj.Count
                End Get
            End Property

            Public Overridable ReadOnly Property IsSynchronized() As Boolean Implements System.Collections.ICollection.IsSynchronized
                Get
                    Return privColObj.IsSynchronized
                End Get
            End Property

            Public Overridable ReadOnly Property SyncRoot() As Object Implements System.Collections.ICollection.SyncRoot
                Get
                    Return Me
                End Get
            End Property

            Public Overridable Sub CopyTo(ByVal array As System.Array, ByVal index As Integer) Implements System.Collections.ICollection.CopyTo
                privColObj.CopyTo(array, index)
                Dim nCtr As Integer
                nCtr = 0
                Do While (nCtr < array.Length)
                    array.SetValue(New ComputerSystem(CType(array.GetValue(nCtr), System.Management.ManagementObject)), nCtr)
                    nCtr = (nCtr + 1)
                Loop
            End Sub

            Public Overridable Function GetEnumerator() As System.Collections.IEnumerator Implements System.Collections.IEnumerable.GetEnumerator
                Return New ComputerSystemEnumerator(privColObj.GetEnumerator)
            End Function

            Public Class ComputerSystemEnumerator
                Inherits Object
                Implements System.Collections.IEnumerator

                Private privObjEnum As ManagementObjectCollection.ManagementObjectEnumerator

                Public Sub New(ByVal objEnum As ManagementObjectCollection.ManagementObjectEnumerator)
                    MyBase.New()
                    privObjEnum = objEnum
                End Sub

                Public Overridable ReadOnly Property Current() As Object Implements System.Collections.IEnumerator.Current
                    Get
                        Return New ComputerSystem(CType(privObjEnum.Current, System.Management.ManagementObject))
                    End Get
                End Property

                Public Overridable Function MoveNext() As Boolean Implements System.Collections.IEnumerator.MoveNext
                    Return privObjEnum.MoveNext
                End Function

                Public Overridable Sub Reset() Implements System.Collections.IEnumerator.Reset
                    privObjEnum.Reset()
                End Sub
            End Class
        End Class

        'TypeConverter to handle null values for ValueType properties
        Public Class WMIValueTypeConverter
            Inherits TypeConverter

            Private baseConverter As TypeConverter

            Private baseType As System.Type

            Public Sub New(ByVal inBaseType As System.Type)
                MyBase.New()
                baseConverter = TypeDescriptor.GetConverter(inBaseType)
                baseType = inBaseType
            End Sub

            Public Overloads Overrides Function CanConvertFrom(ByVal context As System.ComponentModel.ITypeDescriptorContext, ByVal srcType As System.Type) As Boolean
                Return baseConverter.CanConvertFrom(context, srcType)
            End Function

            Public Overloads Overrides Function CanConvertTo(ByVal context As System.ComponentModel.ITypeDescriptorContext, ByVal destinationType As System.Type) As Boolean
                Return baseConverter.CanConvertTo(context, destinationType)
            End Function

            Public Overloads Overrides Function ConvertFrom(ByVal context As System.ComponentModel.ITypeDescriptorContext, ByVal culture As System.Globalization.CultureInfo, ByVal value As Object) As Object
                Return baseConverter.ConvertFrom(context, culture, value)
            End Function

            Public Overloads Overrides Function CreateInstance(ByVal context As System.ComponentModel.ITypeDescriptorContext, ByVal dictionary As System.Collections.IDictionary) As Object
                Return baseConverter.CreateInstance(context, dictionary)
            End Function

            Public Overloads Overrides Function GetCreateInstanceSupported(ByVal context As System.ComponentModel.ITypeDescriptorContext) As Boolean
                Return baseConverter.GetCreateInstanceSupported(context)
            End Function

            Public Overloads Overrides Function GetProperties(ByVal context As System.ComponentModel.ITypeDescriptorContext, ByVal value As Object, ByVal attributeVar() As System.Attribute) As PropertyDescriptorCollection
                Return baseConverter.GetProperties(context, value, attributeVar)
            End Function

            Public Overloads Overrides Function GetPropertiesSupported(ByVal context As System.ComponentModel.ITypeDescriptorContext) As Boolean
                Return baseConverter.GetPropertiesSupported(context)
            End Function

            Public Overloads Overrides Function GetStandardValues(ByVal context As System.ComponentModel.ITypeDescriptorContext) As System.ComponentModel.TypeConverter.StandardValuesCollection
                Return baseConverter.GetStandardValues(context)
            End Function

            Public Overloads Overrides Function GetStandardValuesExclusive(ByVal context As System.ComponentModel.ITypeDescriptorContext) As Boolean
                Return baseConverter.GetStandardValuesExclusive(context)
            End Function

            Public Overloads Overrides Function GetStandardValuesSupported(ByVal context As System.ComponentModel.ITypeDescriptorContext) As Boolean
                Return baseConverter.GetStandardValuesSupported(context)
            End Function

            Public Overloads Overrides Function ConvertTo(ByVal context As System.ComponentModel.ITypeDescriptorContext, ByVal culture As System.Globalization.CultureInfo, ByVal value As Object, ByVal destinationType As System.Type) As Object
                If (baseType.BaseType Is GetType(System.[Enum])) Then
                    If (value.GetType Is destinationType) Then
                        Return value
                    End If
                    If (((value = Nothing) _
                                AndAlso (Not (context) Is Nothing)) _
                                AndAlso (context.PropertyDescriptor.ShouldSerializeValue(context.Instance) = False)) Then
                        Return "NULL_ENUM_VALUE"
                    End If
                    Return baseConverter.ConvertTo(context, culture, value, destinationType)
                End If
                If ((baseType Is GetType(Boolean)) _
                            AndAlso (baseType.BaseType Is GetType(System.ValueType))) Then
                    If (((value = Nothing) _
                                AndAlso (Not (context) Is Nothing)) _
                                AndAlso (context.PropertyDescriptor.ShouldSerializeValue(context.Instance) = False)) Then
                        Return ""
                    End If
                    Return baseConverter.ConvertTo(context, culture, value, destinationType)
                End If
                If ((Not (context) Is Nothing) _
                            AndAlso (context.PropertyDescriptor.ShouldSerializeValue(context.Instance) = False)) Then
                    Return ""
                End If
                Return baseConverter.ConvertTo(context, culture, value, destinationType)
            End Function
        End Class

        'Embedded class to represent WMI system Properties.
        <TypeConverter(GetType(System.ComponentModel.ExpandableObjectConverter))> _
        Public Class ManagementSystemProperties

            Private PrivateLateBoundObject As System.Management.ManagementBaseObject

            Public Sub New(ByVal ManagedObject As System.Management.ManagementBaseObject)
                MyBase.New()
                PrivateLateBoundObject = ManagedObject
            End Sub

            <Browsable(True)> _
            Public ReadOnly Property GENUS() As Integer
                Get
                    Return CType(PrivateLateBoundObject("__GENUS"), Integer)
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property [CLASS]() As String
                Get
                    Return CType(PrivateLateBoundObject("__CLASS"), String)
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property SUPERCLASS() As String
                Get
                    Return CType(PrivateLateBoundObject("__SUPERCLASS"), String)
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property DYNASTY() As String
                Get
                    Return CType(PrivateLateBoundObject("__DYNASTY"), String)
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property RELPATH() As String
                Get
                    Return CType(PrivateLateBoundObject("__RELPATH"), String)
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property PROPERTY_COUNT() As Integer
                Get
                    Return CType(PrivateLateBoundObject("__PROPERTY_COUNT"), Integer)
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property DERIVATION() As String()
                Get
                    Return CType(PrivateLateBoundObject("__DERIVATION"), String())
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property SERVER() As String
                Get
                    Return CType(PrivateLateBoundObject("__SERVER"), String)
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property [NAMESPACE]() As String
                Get
                    Return CType(PrivateLateBoundObject("__NAMESPACE"), String)
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property PATH() As String
                Get
                    Return CType(PrivateLateBoundObject("__PATH"), String)
                End Get
            End Property
        End Class
#End Region

    End Class ' ComputerSystem

    'Functions ShouldSerialize<PropertyName> are functions used by VS property browser to check if a particular property has to be serialized. These functions are added for all ValueType properties ( properties of type Int32, BOOL etc.. which cannot be set to null). These functions use Is<PropertyName>Null function. These functions are also used in the TypeConverter implementation for the properties to check for NULL value of property so that an empty value can be shown in Property browser in case of Drag and Drop in Visual studio.
    'Functions Is<PropertyName>Null() are used to check if a property is NULL.
    'Functions Reset<PropertyName> are added for Nullable Read/Write properties. These functions are used by VS designer in property browser to set a property to NULL.
    'Every property added to the class for WMI property has attributes set to define its behavior in Visual Studio designer and also to define a TypeConverter to be used.
    'Datetime conversion functions ToDateTime and ToDmtfDateTime are added to the class to convert DMTF datetime to System.DateTime and vice-versa.
    'An Early Bound class generated for the WMI class.Win32_LogicalDisk

    Public Class LogicalDisk
        Inherits System.ComponentModel.Component

        'Private property to hold the WMI namespace in which the class resides.
        Private Shared CreatedWmiNamespace As String = "root\cimv2"

        'Private property to hold the name of WMI class which created this class.
        Private Shared CreatedClassName As String = "Win32_LogicalDisk"

        'Private member variable to hold the ManagementScope which is used by the various methods.
        Private Shared statMgmtScope As System.Management.ManagementScope = Nothing

        Private PrivateSystemProperties As ManagementSystemProperties

        'Underlying lateBound WMI object.
        Private PrivateLateBoundObject As System.Management.ManagementObject

        'Member variable to store the 'automatic commit' behavior for the class.
        Private AutoCommitProp As Boolean

        'Private variable to hold the embedded property representing the instance.
        Private embeddedObj As System.Management.ManagementBaseObject

        'The current WMI object used
        Private curObj As System.Management.ManagementBaseObject

        'Flag to indicate if the instance is an embedded object.
        Private isEmbedded As Boolean

        'Below are different overloads of constructors to initialize an instance of the class with a WMI object.
        Public Sub New()
            MyBase.New()
            Me.InitializeObject(Nothing, Nothing, Nothing)
        End Sub

        Public Sub New(ByVal keyDeviceID As String)
            MyBase.New()
            Me.InitializeObject(Nothing, New System.Management.ManagementPath(LogicalDisk.ConstructPath(keyDeviceID)), Nothing)
        End Sub

        Public Sub New(ByVal mgmtScope As System.Management.ManagementScope, ByVal keyDeviceID As String)
            MyBase.New()
            Me.InitializeObject(CType(mgmtScope, System.Management.ManagementScope), New System.Management.ManagementPath(LogicalDisk.ConstructPath(keyDeviceID)), Nothing)
        End Sub

        Public Sub New(ByVal path As System.Management.ManagementPath, ByVal getOptions As System.Management.ObjectGetOptions)
            MyBase.New()
            Me.InitializeObject(Nothing, path, getOptions)
        End Sub

        Public Sub New(ByVal mgmtScope As System.Management.ManagementScope, ByVal path As System.Management.ManagementPath)
            MyBase.New()
            Me.InitializeObject(mgmtScope, path, Nothing)
        End Sub

        Public Sub New(ByVal path As System.Management.ManagementPath)
            MyBase.New()
            Me.InitializeObject(Nothing, path, Nothing)
        End Sub

        Public Sub New(ByVal mgmtScope As System.Management.ManagementScope, ByVal path As System.Management.ManagementPath, ByVal getOptions As System.Management.ObjectGetOptions)
            MyBase.New()
            Me.InitializeObject(mgmtScope, path, getOptions)
        End Sub

        Public Sub New(ByVal theObject As System.Management.ManagementObject)
            MyBase.New()
            Initialize()
            If (CheckIfProperClass(theObject) = True) Then
                PrivateLateBoundObject = theObject
                PrivateSystemProperties = New ManagementSystemProperties(PrivateLateBoundObject)
                curObj = PrivateLateBoundObject
            Else
                Throw New System.ArgumentException("Class name does not match.")
            End If
        End Sub

        Public Sub New(ByVal theObject As System.Management.ManagementBaseObject)
            MyBase.New()
            Initialize()
            If (CheckIfProperClass(theObject) = True) Then
                embeddedObj = theObject
                PrivateSystemProperties = New ManagementSystemProperties(theObject)
                curObj = embeddedObj
                isEmbedded = True
            Else
                Throw New System.ArgumentException("Class name does not match.")
            End If
        End Sub

        'Property returns the namespace of the WMI class.
        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property OriginatingNamespace() As String
            Get
                Return "root\cimv2"
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property ManagementClassName() As String
            Get
                Dim strRet As String = CreatedClassName
                If (Not (curObj) Is Nothing) Then
                    If (Not (curObj.ClassPath) Is Nothing) Then
                        strRet = CType(curObj("__CLASS"), String)
                        If ((strRet Is Nothing) _
                                    OrElse (strRet Is String.Empty)) Then
                            strRet = CreatedClassName
                        End If
                    End If
                End If
                Return strRet
            End Get
        End Property

        'Property pointing to an embedded object to get System properties of the WMI object.
        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property SystemProperties() As ManagementSystemProperties
            Get
                Return PrivateSystemProperties
            End Get
        End Property

        'Property returning the underlying lateBound object.
        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property LateBoundObject() As System.Management.ManagementBaseObject
            Get
                Return curObj
            End Get
        End Property

        'ManagementScope of the object.
        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public Property Scope() As System.Management.ManagementScope
            Get
                If (isEmbedded = False) Then
                    Return PrivateLateBoundObject.Scope
                Else
                    Return Nothing
                End If
            End Get
            Set(ByVal value As System.Management.ManagementScope)
                If (isEmbedded = False) Then
                    PrivateLateBoundObject.Scope = value
                End If
            End Set
        End Property

        'Property to show the commit behavior for the WMI object. If true, WMI object will be automatically saved after each property modification.(ie. Put() is called after modification of a property).
        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public Property AutoCommit() As Boolean
            Get
                Return AutoCommitProp
            End Get
            Set(ByVal value As Boolean)
                AutoCommitProp = value
            End Set
        End Property

        'The ManagementPath of the underlying WMI object.
        <Browsable(True)> _
        Public Property Path() As System.Management.ManagementPath
            Get
                If (isEmbedded = False) Then
                    Return PrivateLateBoundObject.Path
                Else
                    Return Nothing
                End If
            End Get
            Set(ByVal value As System.Management.ManagementPath)
                If (isEmbedded = False) Then
                    If (CheckIfProperClass(Nothing, value, Nothing) <> True) Then
                        Throw New System.ArgumentException("Class name does not match.")
                    End If
                    PrivateLateBoundObject.Path = value
                End If
            End Set
        End Property

        'Public static scope property which is used by the various methods.
        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public Shared Property StaticScope() As System.Management.ManagementScope
            Get
                Return statMgmtScope
            End Get
            Set(ByVal value As System.Management.ManagementScope)
                statMgmtScope = value
            End Set
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsAccessNull() As Boolean
            Get
                If (curObj("Access") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("Access describes whether the media is readable (value=1), writeable (value=2), or" & _
            " both (value=3). ""Unknown"" (0) and ""Write Once"" (4) can also be defined."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property Access() As AccessValues
            Get
                If (curObj("Access") Is Nothing) Then
                    Return CType(System.Convert.ToInt32(5), AccessValues)
                End If
                Return CType(System.Convert.ToInt32(curObj("Access")), AccessValues)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsAvailabilityNull() As Boolean
            Get
                If (curObj("Availability") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The availability and status of the device.  For example, the Availability propert" & _
            "y indicates that the device is running and has full power (value=3), or is in a " & _
            "warning (4), test (5), degraded (10) or power save state (values 13-15 and 17). " & _
            "Regarding the power saving states, these are defined as follows: Value 13 (""Powe" & _
            "r Save - Unknown"") indicates that the device is known to be in a power save mode" & _
            ", but its exact status in this mode is unknown; 14 (""Power Save - Low Power Mode" & _
            """) indicates that the device is in a power save state but still functioning, and" & _
            " may exhibit degraded performance; 15 (""Power Save - Standby"") describes that th" & _
            "e device is not functioning but could be brought to full power 'quickly'; and va" & _
            "lue 17 (""Power Save - Warning"") indicates that the device is in a warning state," & _
            " though also in a power save mode."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property Availability() As AvailabilityValues
            Get
                If (curObj("Availability") Is Nothing) Then
                    Return CType(System.Convert.ToInt32(0), AvailabilityValues)
                End If
                Return CType(System.Convert.ToInt32(curObj("Availability")), AvailabilityValues)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsBlockSizeNull() As Boolean
            Get
                If (curObj("BlockSize") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("Size in bytes of the blocks which form this StorageExtent. If variable block size" & _
            ", then the maximum block size in bytes should be specified. If the block size is" & _
            " unknown or if a block concept is not valid (for example, for Aggregate Extents," & _
            " Memory or LogicalDisks), enter a 1."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property BlockSize() As ULong
            Get
                If (curObj("BlockSize") Is Nothing) Then
                    Return System.Convert.ToUInt64(0)
                End If
                Return CType(curObj("BlockSize"), ULong)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The Caption property is a short textual description (one-line string) of the obje" & _
            "ct.")> _
        Public ReadOnly Property Caption() As String
            Get
                Return CType(curObj("Caption"), String)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsCompressedNull() As Boolean
            Get
                If (curObj("Compressed") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The Compressed property indicates whether the logical volume exists as a single c" & _
            "ompressed entity, such as a DoubleSpace volume.  If file based compression is su" & _
            "pported (such as on NTFS), this property will be FALSE."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property Compressed() As Boolean
            Get
                If (curObj("Compressed") Is Nothing) Then
                    Return System.Convert.ToBoolean(0)
                End If
                Return CType(curObj("Compressed"), Boolean)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsConfigManagerErrorCodeNull() As Boolean
            Get
                If (curObj("ConfigManagerErrorCode") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("Indicates the Win32 Configuration Manager error code.  The following values may b" & _
            "e returned: " & Global.Microsoft.VisualBasic.ChrW(10) & "0      This device is working properly. " & Global.Microsoft.VisualBasic.ChrW(10) & "1      This device is not " & _
            "configured correctly. " & Global.Microsoft.VisualBasic.ChrW(10) & "2      Windows cannot load the driver for this device. " & Global.Microsoft.VisualBasic.ChrW(10) & "3" & _
            "      The driver for this device might be corrupted, or your system may be runni" & _
            "ng low on memory or other resources. " & Global.Microsoft.VisualBasic.ChrW(10) & "4      This device is not working properly" & _
            ". One of its drivers or your registry might be corrupted. " & Global.Microsoft.VisualBasic.ChrW(10) & "5      The driver for" & _
            " this device needs a resource that Windows cannot manage. " & Global.Microsoft.VisualBasic.ChrW(10) & "6      The boot confi" & _
            "guration for this device conflicts with other devices. " & Global.Microsoft.VisualBasic.ChrW(10) & "7      Cannot filter. " & Global.Microsoft.VisualBasic.ChrW(10) & "8" & _
            "      The driver loader for the device is missing. " & Global.Microsoft.VisualBasic.ChrW(10) & "9      This device is not wo" & _
            "rking properly because the controlling firmware is reporting the resources for t" & _
            "he device incorrectly. " & Global.Microsoft.VisualBasic.ChrW(10) & "10     This device cannot start. " & Global.Microsoft.VisualBasic.ChrW(10) & "11     This device fai" & _
            "led. " & Global.Microsoft.VisualBasic.ChrW(10) & "12     This device cannot find enough free resources that it can use. " & Global.Microsoft.VisualBasic.ChrW(10) & "13 " & _
            "    Windows cannot verify this device's resources. " & Global.Microsoft.VisualBasic.ChrW(10) & "14     This device cannot wo" & _
            "rk properly until you restart your computer. " & Global.Microsoft.VisualBasic.ChrW(10) & "15     This device is not working " & _
            "properly because there is probably a re-enumeration problem. " & Global.Microsoft.VisualBasic.ChrW(10) & "16     Windows can" & _
            "not identify all the resources this device uses. " & Global.Microsoft.VisualBasic.ChrW(10) & "17     This device is asking f" & _
            "or an unknown resource type. " & Global.Microsoft.VisualBasic.ChrW(10) & "18     Reinstall the drivers for this device. " & Global.Microsoft.VisualBasic.ChrW(10) & "19 " & _
            "    Your registry might be corrupted. " & Global.Microsoft.VisualBasic.ChrW(10) & "20     Failure using the VxD loader. " & Global.Microsoft.VisualBasic.ChrW(10) & "21 " & _
            "    System failure: Try changing the driver for this device. If that does not wo" & _
            "rk, see your hardware documentation. Windows is removing this device. " & Global.Microsoft.VisualBasic.ChrW(10) & "22     Th" & _
            "is device is disabled. " & Global.Microsoft.VisualBasic.ChrW(10) & "23     System failure: Try changing the driver for this " & _
            "device. If that doesn't work, see your hardware documentation. " & Global.Microsoft.VisualBasic.ChrW(10) & "24     This devi" & _
            "ce is not present, is not working properly, or does not have all its drivers ins" & _
            "talled. " & Global.Microsoft.VisualBasic.ChrW(10) & "25     Windows is still setting up this device. " & Global.Microsoft.VisualBasic.ChrW(10) & "26     Windows is stil" & _
            "l setting up this device. " & Global.Microsoft.VisualBasic.ChrW(10) & "27     This device does not have valid log configurat" & _
            "ion. " & Global.Microsoft.VisualBasic.ChrW(10) & "28     The drivers for this device are not installed. " & Global.Microsoft.VisualBasic.ChrW(10) & "29     This device " & _
            "is disabled because the firmware of the device did not give it the required reso" & _
            "urces. " & Global.Microsoft.VisualBasic.ChrW(10) & "30     This device is using an Interrupt Request (IRQ) resource that ano" & _
            "ther device is using. " & Global.Microsoft.VisualBasic.ChrW(10) & "31     This device is not working properly because Window" & _
            "s cannot load the drivers required for this device."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property ConfigManagerErrorCode() As ConfigManagerErrorCodeValues
            Get
                If (curObj("ConfigManagerErrorCode") Is Nothing) Then
                    Return CType(System.Convert.ToInt32(32), ConfigManagerErrorCodeValues)
                End If
                Return CType(System.Convert.ToInt32(curObj("ConfigManagerErrorCode")), ConfigManagerErrorCodeValues)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsConfigManagerUserConfigNull() As Boolean
            Get
                If (curObj("ConfigManagerUserConfig") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("Indicates whether the device is using a user-defined configuration."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property ConfigManagerUserConfig() As Boolean
            Get
                If (curObj("ConfigManagerUserConfig") Is Nothing) Then
                    Return System.Convert.ToBoolean(0)
                End If
                Return CType(curObj("ConfigManagerUserConfig"), Boolean)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("CreationClassName indicates the name of the class or the subclass used in the cre" & _
            "ation of an instance. When used with the other key properties of this class, thi" & _
            "s property allows all instances of this class and its subclasses to be uniquely " & _
            "identified.")> _
        Public ReadOnly Property CreationClassName() As String
            Get
                Return CType(curObj("CreationClassName"), String)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The Description property provides a textual description of the object. ")> _
        Public ReadOnly Property Description() As String
            Get
                Return CType(curObj("Description"), String)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The DeviceID property contains a string uniquely identifying the logical disk fro" & _
            "m other devices on the system.")> _
        Public ReadOnly Property DeviceID() As String
            Get
                Return CType(curObj("DeviceID"), String)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsDriveTypeNull() As Boolean
            Get
                If (curObj("DriveType") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The DriveType property contains a numeric value corresponding to the type of disk" & _
            " drive this logical disk represents.  Please refer to the Platform SDK documenta" & _
            "tion for additional values." & Global.Microsoft.VisualBasic.ChrW(10) & "Example: A CD-ROM drive would return 5."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property DriveType() As DriveTypeValues
            Get
                If (curObj("DriveType") Is Nothing) Then
                    Return CType(System.Convert.ToInt32(7), DriveTypeValues)
                End If
                Return CType(System.Convert.ToInt32(curObj("DriveType")), DriveTypeValues)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsErrorClearedNull() As Boolean
            Get
                If (curObj("ErrorCleared") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("ErrorCleared is a boolean property indicating that the error reported in LastErro" & _
            "rCode property is now cleared."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property ErrorCleared() As Boolean
            Get
                If (curObj("ErrorCleared") Is Nothing) Then
                    Return System.Convert.ToBoolean(0)
                End If
                Return CType(curObj("ErrorCleared"), Boolean)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("ErrorDescription is a free-form string supplying more information about the error" & _
            " recorded in LastErrorCode property, and information on any corrective actions t" & _
            "hat may be taken.")> _
        Public ReadOnly Property ErrorDescription() As String
            Get
                Return CType(curObj("ErrorDescription"), String)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("ErrorMethodology is a free-form string describing the type of error detection and" & _
            " correction supported by this storage extent.")> _
        Public ReadOnly Property ErrorMethodology() As String
            Get
                Return CType(curObj("ErrorMethodology"), String)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The FileSystem property indicates the file system on the logical disk." & Global.Microsoft.VisualBasic.ChrW(10) & "Example: N" & _
            "TFS")> _
        Public ReadOnly Property FileSystem() As String
            Get
                Return CType(curObj("FileSystem"), String)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsFreeSpaceNull() As Boolean
            Get
                If (curObj("FreeSpace") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The FreeSpace property indicates in bytes how much free space is available on the" & _
            " logical disk."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property FreeSpace() As ULong
            Get
                If (curObj("FreeSpace") Is Nothing) Then
                    Return System.Convert.ToUInt64(0)
                End If
                Return CType(curObj("FreeSpace"), ULong)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsInstallDateNull() As Boolean
            Get
                If (curObj("InstallDate") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The InstallDate property is datetime value indicating when the object was install" & _
            "ed. A lack of a value does not indicate that the object is not installed."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property InstallDate() As Date
            Get
                If (Not (curObj("InstallDate")) Is Nothing) Then
                    Return ToDateTime(CType(curObj("InstallDate"), String))
                Else
                    Return Date.MinValue
                End If
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsLastErrorCodeNull() As Boolean
            Get
                If (curObj("LastErrorCode") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("LastErrorCode captures the last error code reported by the logical device."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property LastErrorCode() As UInteger
            Get
                If (curObj("LastErrorCode") Is Nothing) Then
                    Return System.Convert.ToUInt32(0)
                End If
                Return CType(curObj("LastErrorCode"), UInteger)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsMaximumComponentLengthNull() As Boolean
            Get
                If (curObj("MaximumComponentLength") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The MaximumComponentLength property contains the maximum length of a filename com" & _
            "ponent supported by the Win32 drive. A filename component is that portion of a f" & _
            "ilename between backslashes.  The value can be used to indicate that long names " & _
            "are supported by the specified file system. For example, for a FAT file system s" & _
            "upporting long names, the function stores the value 255, rather than the previou" & _
            "s 8.3 indicator. Long names can also be supported on systems that use the NTFS f" & _
            "ile system." & Global.Microsoft.VisualBasic.ChrW(10) & "Example: 255"), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property MaximumComponentLength() As UInteger
            Get
                If (curObj("MaximumComponentLength") Is Nothing) Then
                    Return System.Convert.ToUInt32(0)
                End If
                Return CType(curObj("MaximumComponentLength"), UInteger)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsMediaTypeNull() As Boolean
            Get
                If (curObj("MediaType") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The MediaType property indicates the type of media currently present in the logic" & _
            "al drive. This value will be one of the values of the MEDIA_TYPE enumeration def" & _
            "ined in winioctl.h." & Global.Microsoft.VisualBasic.ChrW(10) & "<B>Note:</B> The value may not be exact for removable drives" & _
            " if currently there is no media in the drive."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property MediaType() As MediaTypeValues
            Get
                If (curObj("MediaType") Is Nothing) Then
                    Return CType(System.Convert.ToInt32(23), MediaTypeValues)
                End If
                Return CType(System.Convert.ToInt32(curObj("MediaType")), MediaTypeValues)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The Name property defines the label by which the object is known. When subclassed" & _
            ", the Name property can be overridden to be a Key property.")> _
        Public ReadOnly Property Name() As String
            Get
                Return CType(curObj("Name"), String)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsNumberOfBlocksNull() As Boolean
            Get
                If (curObj("NumberOfBlocks") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("Total number of consecutive blocks, each block the size of the value contained in" & _
            " the BlockSize property, which form this storage extent. Total size of the stora" & _
            "ge extent can be calculated by multiplying the value of the BlockSize property b" & _
            "y the value of this property. If the value of BlockSize is 1, this property is t" & _
            "he total size of the storage extent."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property NumberOfBlocks() As ULong
            Get
                If (curObj("NumberOfBlocks") Is Nothing) Then
                    Return System.Convert.ToUInt64(0)
                End If
                Return CType(curObj("NumberOfBlocks"), ULong)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("Indicates the Win32 Plug and Play device ID of the logical device.  Example: *PNP" & _
            "030b")> _
        Public ReadOnly Property PNPDeviceID() As String
            Get
                Return CType(curObj("PNPDeviceID"), String)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("Indicates the specific power-related capabilities of the logical device. The arra" & _
            "y values, 0=""Unknown"", 1=""Not Supported"" and 2=""Disabled"" are self-explanatory. " & _
            "The value, 3=""Enabled"" indicates that the power management features are currentl" & _
            "y enabled but the exact feature set is unknown or the information is unavailable" & _
            ". ""Power Saving Modes Entered Automatically"" (4) describes that a device can cha" & _
            "nge its power state based on usage or other criteria. ""Power State Settable"" (5)" & _
            " indicates that the SetPowerState method is supported. ""Power Cycling Supported""" & _
            " (6) indicates that the SetPowerState method can be invoked with the PowerState " & _
            "input variable set to 5 (""Power Cycle""). ""Timed Power On Supported"" (7) indicate" & _
            "s that the SetPowerState method can be invoked with the PowerState input variabl" & _
            "e set to 5 (""Power Cycle"") and the Time parameter set to a specific date and tim" & _
            "e, or interval, for power-on.")> _
        Public ReadOnly Property PowerManagementCapabilities() As PowerManagementCapabilitiesValues()
            Get
                Dim arrEnumVals As System.Array = CType(curObj("PowerManagementCapabilities"), System.Array)
                Dim enumToRet((arrEnumVals.Length) - 1) As PowerManagementCapabilitiesValues
                Dim counter As Integer = 0
                counter = 0
                Do While (counter < arrEnumVals.Length)
                    enumToRet(counter) = CType(System.Convert.ToInt32(arrEnumVals.GetValue(counter)), PowerManagementCapabilitiesValues)
                    counter = (counter + 1)
                Loop
                Return enumToRet
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsPowerManagementSupportedNull() As Boolean
            Get
                If (curObj("PowerManagementSupported") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("Boolean indicating that the Device can be power managed - ie, put into a power sa" & _
            "ve state. This boolean does not indicate that power management features are curr" & _
            "ently enabled, or if enabled, what features are supported. Refer to the PowerMan" & _
            "agementCapabilities array for this information. If this boolean is false, the in" & _
            "teger value 1, for the string, ""Not Supported"", should be the only entry in the " & _
            "PowerManagementCapabilities array."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property PowerManagementSupported() As Boolean
            Get
                If (curObj("PowerManagementSupported") Is Nothing) Then
                    Return System.Convert.ToBoolean(0)
                End If
                Return CType(curObj("PowerManagementSupported"), Boolean)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The ProviderName property indicates the network path name to the logical device.")> _
        Public ReadOnly Property ProviderName() As String
            Get
                Return CType(curObj("ProviderName"), String)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("A free form string describing the media and/or its use.")> _
        Public ReadOnly Property Purpose() As String
            Get
                Return CType(curObj("Purpose"), String)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsQuotasDisabledNull() As Boolean
            Get
                If (curObj("QuotasDisabled") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The QuotasDisabled property indicates that Quota management is not enabled on thi" & _
            "s volume."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property QuotasDisabled() As Boolean
            Get
                If (curObj("QuotasDisabled") Is Nothing) Then
                    Return System.Convert.ToBoolean(0)
                End If
                Return CType(curObj("QuotasDisabled"), Boolean)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsQuotasIncompleteNull() As Boolean
            Get
                If (curObj("QuotasIncomplete") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The QuotasIncomplete property indicates that Quota management was used but has be" & _
            "en disabled.  Incomplete refers to the information left in the file system  afte" & _
            "r quota management has been disabled."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property QuotasIncomplete() As Boolean
            Get
                If (curObj("QuotasIncomplete") Is Nothing) Then
                    Return System.Convert.ToBoolean(0)
                End If
                Return CType(curObj("QuotasIncomplete"), Boolean)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsQuotasRebuildingNull() As Boolean
            Get
                If (curObj("QuotasRebuilding") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The QuotasRebuilding property indicates an active state signifying that the file " & _
            "system is in process of compiling information and setting the disk up for quota " & _
            "management."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property QuotasRebuilding() As Boolean
            Get
                If (curObj("QuotasRebuilding") Is Nothing) Then
                    Return System.Convert.ToBoolean(0)
                End If
                Return CType(curObj("QuotasRebuilding"), Boolean)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsSizeNull() As Boolean
            Get
                If (curObj("Size") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The Size property indicates in bytes, the size of the logical disk."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property Size() As ULong
            Get
                If (curObj("Size") Is Nothing) Then
                    Return System.Convert.ToUInt64(0)
                End If
                Return CType(curObj("Size"), ULong)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The Status property is a string indicating the current status of the object. Vari" & _
            "ous operational and non-operational statuses can be defined. Operational statuse" & _
            "s are ""OK"", ""Degraded"" and ""Pred Fail"". ""Pred Fail"" indicates that an element ma" & _
            "y be functioning properly but predicting a failure in the near future. An exampl" & _
            "e is a SMART-enabled hard drive. Non-operational statuses can also be specified." & _
            " These are ""Error"", ""Starting"", ""Stopping"" and ""Service"". The latter, ""Service""," & _
            " could apply during mirror-resilvering of a disk, reload of a user permissions l" & _
            "ist, or other administrative work. Not all such work is on-line, yet the managed" & _
            " element is neither ""OK"" nor in one of the other states.")> _
        Public ReadOnly Property Status() As String
            Get
                Return CType(curObj("Status"), String)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsStatusInfoNull() As Boolean
            Get
                If (curObj("StatusInfo") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("StatusInfo is a string indicating whether the logical device is in an enabled (va" & _
            "lue = 3), disabled (value = 4) or some other (1) or unknown (2) state. If this p" & _
            "roperty does not apply to the logical device, the value, 5 (""Not Applicable""), s" & _
            "hould be used."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property StatusInfo() As StatusInfoValues
            Get
                If (curObj("StatusInfo") Is Nothing) Then
                    Return CType(System.Convert.ToInt32(0), StatusInfoValues)
                End If
                Return CType(System.Convert.ToInt32(curObj("StatusInfo")), StatusInfoValues)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsSupportsDiskQuotasNull() As Boolean
            Get
                If (curObj("SupportsDiskQuotas") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The SupportsDiskQuotas property indicates whether this volume supports disk Quota" & _
            "s"), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property SupportsDiskQuotas() As Boolean
            Get
                If (curObj("SupportsDiskQuotas") Is Nothing) Then
                    Return System.Convert.ToBoolean(0)
                End If
                Return CType(curObj("SupportsDiskQuotas"), Boolean)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsSupportsFileBasedCompressionNull() As Boolean
            Get
                If (curObj("SupportsFileBasedCompression") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The SupportsFileBasedCompression property indicates whether the logical disk part" & _
            "ition supports file based compression, such as is the case with NTFS. This prope" & _
            "rty is FALSE, when the Compressed property is TRUE." & Global.Microsoft.VisualBasic.ChrW(10) & "Values: TRUE or FALSE. If TR" & _
            "UE, the logical disk supports file based compression."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property SupportsFileBasedCompression() As Boolean
            Get
                If (curObj("SupportsFileBasedCompression") Is Nothing) Then
                    Return System.Convert.ToBoolean(0)
                End If
                Return CType(curObj("SupportsFileBasedCompression"), Boolean)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The scoping System's CreationClassName.")> _
        Public ReadOnly Property SystemCreationClassName() As String
            Get
                Return CType(curObj("SystemCreationClassName"), String)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The scoping System's Name.")> _
        Public ReadOnly Property SystemName() As String
            Get
                Return CType(curObj("SystemName"), String)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsVolumeDirtyNull() As Boolean
            Get
                If (curObj("VolumeDirty") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The VolumeDirty property indicates whether the disk requires chkdsk to be run at " & _
            "next boot up time. The property is applicable to only those instances of logical" & _
            " disk that represent a physical disk in the machine. It is not applicable to map" & _
            "ped logical drives. "), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property VolumeDirty() As Boolean
            Get
                If (curObj("VolumeDirty") Is Nothing) Then
                    Return System.Convert.ToBoolean(0)
                End If
                Return CType(curObj("VolumeDirty"), Boolean)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The VolumeName property indicates the volume name of the logical disk." & Global.Microsoft.VisualBasic.ChrW(10) & "Constraint" & _
            "s: Maximum 32 characters")> _
        Public Property VolumeName() As String
            Get
                Return CType(curObj("VolumeName"), String)
            End Get
            Set(ByVal value As String)
                curObj("VolumeName") = value
                If ((isEmbedded = False) _
                            AndAlso (AutoCommitProp = True)) Then
                    PrivateLateBoundObject.Put()
                End If
            End Set
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The VolumeSerialNumber property indicates the volume serial number of the logical" & _
            " disk." & Global.Microsoft.VisualBasic.ChrW(10) & "Constraints: Maximum 11 characters" & Global.Microsoft.VisualBasic.ChrW(10) & "Example: A8C3-D032")> _
        Public ReadOnly Property VolumeSerialNumber() As String
            Get
                Return CType(curObj("VolumeSerialNumber"), String)
            End Get
        End Property

        Private Overloads Function CheckIfProperClass(ByVal mgmtScope As System.Management.ManagementScope, ByVal path As System.Management.ManagementPath, ByVal OptionsParam As System.Management.ObjectGetOptions) As Boolean
            If ((Not (path) Is Nothing) _
                        AndAlso (String.Compare(path.ClassName, Me.ManagementClassName, True, System.Globalization.CultureInfo.InvariantCulture) = 0)) Then
                Return True
            Else
                Return CheckIfProperClass(New System.Management.ManagementObject(mgmtScope, path, OptionsParam))
            End If
        End Function

        Private Overloads Function CheckIfProperClass(ByVal theObj As System.Management.ManagementBaseObject) As Boolean
            If ((Not (theObj) Is Nothing) _
                        AndAlso (String.Compare(CType(theObj("__CLASS"), String), Me.ManagementClassName, True, System.Globalization.CultureInfo.InvariantCulture) = 0)) Then
                Return True
            Else
                Dim parentClasses As System.Array = CType(theObj("__DERIVATION"), System.Array)
                If (Not (parentClasses) Is Nothing) Then
                    Dim count As Integer = 0
                    count = 0
                    Do While (count < parentClasses.Length)
                        If (String.Compare(CType(parentClasses.GetValue(count), String), Me.ManagementClassName, True, System.Globalization.CultureInfo.InvariantCulture) = 0) Then
                            Return True
                        End If
                        count = (count + 1)
                    Loop
                End If
            End If
            Return False
        End Function

        Private Function ShouldSerializeAccess() As Boolean
            If (Me.IsAccessNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeAvailability() As Boolean
            If (Me.IsAvailabilityNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeBlockSize() As Boolean
            If (Me.IsBlockSizeNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeCompressed() As Boolean
            If (Me.IsCompressedNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeConfigManagerErrorCode() As Boolean
            If (Me.IsConfigManagerErrorCodeNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeConfigManagerUserConfig() As Boolean
            If (Me.IsConfigManagerUserConfigNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeDriveType() As Boolean
            If (Me.IsDriveTypeNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeErrorCleared() As Boolean
            If (Me.IsErrorClearedNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeFreeSpace() As Boolean
            If (Me.IsFreeSpaceNull = False) Then
                Return True
            End If
            Return False
        End Function

        'Converts a given datetime in DMTF format to System.DateTime object.
        Shared Function ToDateTime(ByVal dmtfDate As String) As Date
            Dim initializer As Date = Date.MinValue
            Dim year As Integer = initializer.Year
            Dim month As Integer = initializer.Month
            Dim day As Integer = initializer.Day
            Dim hour As Integer = initializer.Hour
            Dim minute As Integer = initializer.Minute
            Dim second As Integer = initializer.Second
            Dim ticks As Long = 0
            Dim dmtf As String = dmtfDate
            Dim datetime As Date = Date.MinValue
            Dim tempString As String = String.Empty
            If (dmtf Is Nothing) Then
                Throw New System.ArgumentOutOfRangeException
            End If
            If (dmtf.Length = 0) Then
                Throw New System.ArgumentOutOfRangeException
            End If
            If (dmtf.Length <> 25) Then
                Throw New System.ArgumentOutOfRangeException
            End If
            Try
                tempString = dmtf.Substring(0, 4)
                If ("****" <> tempString) Then
                    year = Integer.Parse(tempString)
                End If
                tempString = dmtf.Substring(4, 2)
                If ("**" <> tempString) Then
                    month = Integer.Parse(tempString)
                End If
                tempString = dmtf.Substring(6, 2)
                If ("**" <> tempString) Then
                    day = Integer.Parse(tempString)
                End If
                tempString = dmtf.Substring(8, 2)
                If ("**" <> tempString) Then
                    hour = Integer.Parse(tempString)
                End If
                tempString = dmtf.Substring(10, 2)
                If ("**" <> tempString) Then
                    minute = Integer.Parse(tempString)
                End If
                tempString = dmtf.Substring(12, 2)
                If ("**" <> tempString) Then
                    second = Integer.Parse(tempString)
                End If
                tempString = dmtf.Substring(15, 6)
                If ("******" <> tempString) Then
                    ticks = (Long.Parse(tempString) * CType((System.TimeSpan.TicksPerMillisecond / 1000), Long))
                End If
                If ((((((((year < 0) _
                            OrElse (month < 0)) _
                            OrElse (day < 0)) _
                            OrElse (hour < 0)) _
                            OrElse (minute < 0)) _
                            OrElse (minute < 0)) _
                            OrElse (second < 0)) _
                            OrElse (ticks < 0)) Then
                    Throw New System.ArgumentOutOfRangeException
                End If
            Catch e As System.Exception
                Throw New System.ArgumentOutOfRangeException(Nothing, e.Message)
            End Try
            datetime = New Date(year, month, day, hour, minute, second, 0)
            datetime = datetime.AddTicks(ticks)
            Dim tickOffset As System.TimeSpan = System.TimeZone.CurrentTimeZone.GetUtcOffset(datetime)
            Dim UTCOffset As Integer = 0
            Dim OffsetToBeAdjusted As Integer = 0
            Dim OffsetMins As Long = CType((tickOffset.Ticks / System.TimeSpan.TicksPerMinute), Long)
            tempString = dmtf.Substring(22, 3)
            If (tempString <> "******") Then
                tempString = dmtf.Substring(21, 4)
                Try
                    UTCOffset = Integer.Parse(tempString)
                Catch e As System.Exception
                    Throw New System.ArgumentOutOfRangeException(Nothing, e.Message)
                End Try
                OffsetToBeAdjusted = CType((OffsetMins - UTCOffset), Integer)
                datetime = datetime.AddMinutes(CType(OffsetToBeAdjusted, Double))
            End If
            Return datetime
        End Function

        'Converts a given System.DateTime object to DMTF datetime format.
        Shared Function ToDmtfDateTime(ByVal [date] As Date) As String
            Dim utcString As String = String.Empty
            Dim tickOffset As System.TimeSpan = System.TimeZone.CurrentTimeZone.GetUtcOffset([date])
            Dim OffsetMins As Long = CType((tickOffset.Ticks / System.TimeSpan.TicksPerMinute), Long)
            If (System.Math.Abs(OffsetMins) > 999) Then
                [date] = [date].ToUniversalTime
                utcString = "+000"
            Else
                If (tickOffset.Ticks >= 0) Then
                    utcString = String.Concat("+", CType((tickOffset.Ticks / System.TimeSpan.TicksPerMinute), System.Int64).ToString.PadLeft(3, Global.Microsoft.VisualBasic.ChrW(48)))
                Else
                    Dim strTemp As String = CType(OffsetMins, System.Int64).ToString
                    utcString = String.Concat("-", strTemp.Substring(1, (strTemp.Length - 1)).PadLeft(3, Global.Microsoft.VisualBasic.ChrW(48)))
                End If
            End If
            Dim dmtfDateTime As String = CType([date].Year, System.Int32).ToString.PadLeft(4, Global.Microsoft.VisualBasic.ChrW(48))
            dmtfDateTime = String.Concat(dmtfDateTime, CType([date].Month, System.Int32).ToString.PadLeft(2, Global.Microsoft.VisualBasic.ChrW(48)))
            dmtfDateTime = String.Concat(dmtfDateTime, CType([date].Day, System.Int32).ToString.PadLeft(2, Global.Microsoft.VisualBasic.ChrW(48)))
            dmtfDateTime = String.Concat(dmtfDateTime, CType([date].Hour, System.Int32).ToString.PadLeft(2, Global.Microsoft.VisualBasic.ChrW(48)))
            dmtfDateTime = String.Concat(dmtfDateTime, CType([date].Minute, System.Int32).ToString.PadLeft(2, Global.Microsoft.VisualBasic.ChrW(48)))
            dmtfDateTime = String.Concat(dmtfDateTime, CType([date].Second, System.Int32).ToString.PadLeft(2, Global.Microsoft.VisualBasic.ChrW(48)))
            dmtfDateTime = String.Concat(dmtfDateTime, ".")
            Dim dtTemp As Date = New Date([date].Year, [date].Month, [date].Day, [date].Hour, [date].Minute, [date].Second, 0)
            Dim microsec As Long = CType(((([date].Ticks - dtTemp.Ticks) _
                        * 1000) _
                        / System.TimeSpan.TicksPerMillisecond), Long)
            Dim strMicrosec As String = CType(microsec, System.Int64).ToString
            If (strMicrosec.Length > 6) Then
                strMicrosec = strMicrosec.Substring(0, 6)
            End If
            dmtfDateTime = String.Concat(dmtfDateTime, strMicrosec.PadLeft(6, Global.Microsoft.VisualBasic.ChrW(48)))
            dmtfDateTime = String.Concat(dmtfDateTime, utcString)
            Return dmtfDateTime
        End Function

        Private Function ShouldSerializeInstallDate() As Boolean
            If (Me.IsInstallDateNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeLastErrorCode() As Boolean
            If (Me.IsLastErrorCodeNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeMaximumComponentLength() As Boolean
            If (Me.IsMaximumComponentLengthNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeMediaType() As Boolean
            If (Me.IsMediaTypeNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeNumberOfBlocks() As Boolean
            If (Me.IsNumberOfBlocksNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializePowerManagementSupported() As Boolean
            If (Me.IsPowerManagementSupportedNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeQuotasDisabled() As Boolean
            If (Me.IsQuotasDisabledNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeQuotasIncomplete() As Boolean
            If (Me.IsQuotasIncompleteNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeQuotasRebuilding() As Boolean
            If (Me.IsQuotasRebuildingNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeSize() As Boolean
            If (Me.IsSizeNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeStatusInfo() As Boolean
            If (Me.IsStatusInfoNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeSupportsDiskQuotas() As Boolean
            If (Me.IsSupportsDiskQuotasNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeSupportsFileBasedCompression() As Boolean
            If (Me.IsSupportsFileBasedCompressionNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeVolumeDirty() As Boolean
            If (Me.IsVolumeDirtyNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Sub ResetVolumeName()
            curObj("VolumeName") = Nothing
            If ((isEmbedded = False) _
                        AndAlso (AutoCommitProp = True)) Then
                PrivateLateBoundObject.Put()
            End If
        End Sub

        <Browsable(True)> _
        Public Overloads Sub CommitObject()
            If (isEmbedded = False) Then
                PrivateLateBoundObject.Put()
            End If
        End Sub

        <Browsable(True)> _
        Public Overloads Sub CommitObject(ByVal putOptions As System.Management.PutOptions)
            If (isEmbedded = False) Then
                PrivateLateBoundObject.Put(putOptions)
            End If
        End Sub

        Private Sub Initialize()
            AutoCommitProp = True
            isEmbedded = False
        End Sub

        Private Shared Function ConstructPath(ByVal keyDeviceID As String) As String
            Dim strPath As String = "root\cimv2:Win32_LogicalDisk"
            strPath = String.Concat(strPath, String.Concat(".DeviceID=", String.Concat("""", String.Concat(keyDeviceID, """"))))
            Return strPath
        End Function

        Private Sub InitializeObject(ByVal mgmtScope As System.Management.ManagementScope, ByVal path As System.Management.ManagementPath, ByVal getOptions As System.Management.ObjectGetOptions)
            Initialize()
            If (Not (path) Is Nothing) Then
                If (CheckIfProperClass(mgmtScope, path, getOptions) <> True) Then
                    Throw New System.ArgumentException("Class name does not match.")
                End If
            End If
            PrivateLateBoundObject = New System.Management.ManagementObject(mgmtScope, path, getOptions)
            PrivateSystemProperties = New ManagementSystemProperties(PrivateLateBoundObject)
            curObj = PrivateLateBoundObject
        End Sub

        'Different overloads of GetInstances() help in enumerating instances of the WMI class.
        Public Overloads Shared Function GetInstances() As LogicalDiskCollection
            Return GetInstances(Nothing, Nothing, Nothing)
        End Function

        Public Overloads Shared Function GetInstances(ByVal condition As String) As LogicalDiskCollection
            Return GetInstances(Nothing, condition, Nothing)
        End Function

        Public Overloads Shared Function GetInstances(ByVal selectedProperties() As System.String) As LogicalDiskCollection
            Return GetInstances(Nothing, Nothing, selectedProperties)
        End Function

        Public Overloads Shared Function GetInstances(ByVal condition As String, ByVal selectedProperties() As System.String) As LogicalDiskCollection
            Return GetInstances(Nothing, condition, selectedProperties)
        End Function

        Public Overloads Shared Function GetInstances(ByVal mgmtScope As System.Management.ManagementScope, ByVal enumOptions As System.Management.EnumerationOptions) As LogicalDiskCollection
            If (mgmtScope Is Nothing) Then
                If (statMgmtScope Is Nothing) Then
                    mgmtScope = New System.Management.ManagementScope
                    mgmtScope.Path.NamespacePath = "root\cimv2"
                Else
                    mgmtScope = statMgmtScope
                End If
            End If
            Dim pathObj As System.Management.ManagementPath = New System.Management.ManagementPath
            pathObj.ClassName = "Win32_LogicalDisk"
            pathObj.NamespacePath = "root\cimv2"
            Dim clsObject As System.Management.ManagementClass = New System.Management.ManagementClass(mgmtScope, pathObj, Nothing)
            If (enumOptions Is Nothing) Then
                enumOptions = New System.Management.EnumerationOptions
                enumOptions.EnsureLocatable = True
            End If
            Return New LogicalDiskCollection(clsObject.GetInstances(enumOptions))
        End Function

        Public Overloads Shared Function GetInstances(ByVal mgmtScope As System.Management.ManagementScope, ByVal condition As String) As LogicalDiskCollection
            Return GetInstances(mgmtScope, condition, Nothing)
        End Function

        Public Overloads Shared Function GetInstances(ByVal mgmtScope As System.Management.ManagementScope, ByVal selectedProperties() As System.String) As LogicalDiskCollection
            Return GetInstances(mgmtScope, Nothing, selectedProperties)
        End Function

        Public Overloads Shared Function GetInstances(ByVal mgmtScope As System.Management.ManagementScope, ByVal condition As String, ByVal selectedProperties() As System.String) As LogicalDiskCollection
            If (mgmtScope Is Nothing) Then
                If (statMgmtScope Is Nothing) Then
                    mgmtScope = New System.Management.ManagementScope
                    mgmtScope.Path.NamespacePath = "root\cimv2"
                Else
                    mgmtScope = statMgmtScope
                End If
            End If
            Dim ObjectSearcher As System.Management.ManagementObjectSearcher = New System.Management.ManagementObjectSearcher(mgmtScope, New SelectQuery("Win32_LogicalDisk", condition, selectedProperties))
            Dim enumOptions As System.Management.EnumerationOptions = New System.Management.EnumerationOptions
            enumOptions.EnsureLocatable = True
            ObjectSearcher.Options = enumOptions
            Return New LogicalDiskCollection(ObjectSearcher.Get)
        End Function

        <Browsable(True)> _
        Public Shared Function CreateInstance() As LogicalDisk
            Dim mgmtScope As System.Management.ManagementScope = Nothing
            If (statMgmtScope Is Nothing) Then
                mgmtScope = New System.Management.ManagementScope
                mgmtScope.Path.NamespacePath = CreatedWmiNamespace
            Else
                mgmtScope = statMgmtScope
            End If
            Dim mgmtPath As System.Management.ManagementPath = New System.Management.ManagementPath(CreatedClassName)
            Dim tmpMgmtClass As System.Management.ManagementClass = New System.Management.ManagementClass(mgmtScope, mgmtPath, Nothing)
            Return New LogicalDisk(tmpMgmtClass.CreateInstance)
        End Function

        <Browsable(True)> _
        Public Sub Delete()
            PrivateLateBoundObject.Delete()
        End Sub

        Public Function Chkdsk(ByVal FixErrors As Boolean, ByVal ForceDismount As Boolean, ByVal OkToRunAtBootUp As Boolean, ByVal RecoverBadSectors As Boolean, ByVal SkipFolderCycle As Boolean, ByVal VigorousIndexCheck As Boolean) As UInteger
            If (isEmbedded = False) Then
                Dim inParams As System.Management.ManagementBaseObject = Nothing
                inParams = PrivateLateBoundObject.GetMethodParameters("Chkdsk")
                inParams("FixErrors") = CType(FixErrors, System.Boolean)
                inParams("ForceDismount") = CType(ForceDismount, System.Boolean)
                inParams("OkToRunAtBootUp") = CType(OkToRunAtBootUp, System.Boolean)
                inParams("RecoverBadSectors") = CType(RecoverBadSectors, System.Boolean)
                inParams("SkipFolderCycle") = CType(SkipFolderCycle, System.Boolean)
                inParams("VigorousIndexCheck") = CType(VigorousIndexCheck, System.Boolean)
                Dim outParams As System.Management.ManagementBaseObject = PrivateLateBoundObject.InvokeMethod("Chkdsk", inParams, Nothing)
                Return System.Convert.ToUInt32(outParams.Properties("ReturnValue").Value)
            Else
                Return System.Convert.ToUInt32(0)
            End If
        End Function

        Public Shared Function ExcludeFromAutochk(ByVal LogicalDisk() As String) As UInteger
            Dim IsMethodStatic As Boolean = True
            If (IsMethodStatic = True) Then
                Dim inParams As System.Management.ManagementBaseObject = Nothing
                Dim mgmtPath As System.Management.ManagementPath = New System.Management.ManagementPath(CreatedClassName)
                Dim classObj As System.Management.ManagementClass = New System.Management.ManagementClass(statMgmtScope, mgmtPath, Nothing)
                inParams = classObj.GetMethodParameters("ExcludeFromAutochk")
                inParams("LogicalDisk") = CType(LogicalDisk, String())
                Dim outParams As System.Management.ManagementBaseObject = classObj.InvokeMethod("ExcludeFromAutochk", inParams, Nothing)
                Return System.Convert.ToUInt32(outParams.Properties("ReturnValue").Value)
            Else
                Return System.Convert.ToUInt32(0)
            End If
        End Function

        Public Function Reset() As UInteger
            If (isEmbedded = False) Then
                Dim inParams As System.Management.ManagementBaseObject = Nothing
                Dim outParams As System.Management.ManagementBaseObject = PrivateLateBoundObject.InvokeMethod("Reset", inParams, Nothing)
                Return System.Convert.ToUInt32(outParams.Properties("ReturnValue").Value)
            Else
                Return System.Convert.ToUInt32(0)
            End If
        End Function

        Public Shared Function ScheduleAutoChk(ByVal LogicalDisk() As String) As UInteger
            Dim IsMethodStatic As Boolean = True
            If (IsMethodStatic = True) Then
                Dim inParams As System.Management.ManagementBaseObject = Nothing
                Dim mgmtPath As System.Management.ManagementPath = New System.Management.ManagementPath(CreatedClassName)
                Dim classObj As System.Management.ManagementClass = New System.Management.ManagementClass(statMgmtScope, mgmtPath, Nothing)
                inParams = classObj.GetMethodParameters("ScheduleAutoChk")
                inParams("LogicalDisk") = CType(LogicalDisk, String())
                Dim outParams As System.Management.ManagementBaseObject = classObj.InvokeMethod("ScheduleAutoChk", inParams, Nothing)
                Return System.Convert.ToUInt32(outParams.Properties("ReturnValue").Value)
            Else
                Return System.Convert.ToUInt32(0)
            End If
        End Function

        Public Function SetPowerState(ByVal PowerState As UShort, ByVal Time As Date) As UInteger
            If (isEmbedded = False) Then
                Dim inParams As System.Management.ManagementBaseObject = Nothing
                inParams = PrivateLateBoundObject.GetMethodParameters("SetPowerState")
                inParams("PowerState") = CType(PowerState, System.UInt16)
                inParams("Time") = ToDmtfDateTime(CType(Time, Date))
                Dim outParams As System.Management.ManagementBaseObject = PrivateLateBoundObject.InvokeMethod("SetPowerState", inParams, Nothing)
                Return System.Convert.ToUInt32(outParams.Properties("ReturnValue").Value)
            Else
                Return System.Convert.ToUInt32(0)
            End If
        End Function

        Public Enum AccessValues

            Unknown0 = 0

            Readable = 1

            Writeable = 2

            Read_Write_Supported = 3

            Write_Once = 4

            NULL_ENUM_VALUE = 5
        End Enum

        Public Enum AvailabilityValues

            Other0 = 1

            Unknown0 = 2

            Running_Full_Power = 3

            Warning = 4

            In_Test = 5

            Not_Applicable = 6

            Power_Off = 7

            Off_Line = 8

            Off_Duty = 9

            Degraded = 10

            Not_Installed = 11

            Install_Error = 12

            Power_Save_Unknown = 13

            Power_Save_Low_Power_Mode = 14

            Power_Save_Standby = 15

            Power_Cycle = 16

            Power_Save_Warning = 17

            Paused = 18

            Not_Ready = 19

            Not_Configured = 20

            Quiesced = 21

            NULL_ENUM_VALUE = 0
        End Enum

        Public Enum ConfigManagerErrorCodeValues

            This_device_is_working_properly_ = 0

            This_device_is_not_configured_correctly_ = 1

            Windows_cannot_load_the_driver_for_this_device_ = 2

            The_driver_for_this_device_might_be_corrupted_or_your_system_may_be_running_low_on_memory_or_other_resources_ = 3

            This_device_is_not_working_properly_One_of_its_drivers_or_your_registry_might_be_corrupted_ = 4

            The_driver_for_this_device_needs_a_resource_that_Windows_cannot_manage_ = 5

            The_boot_configuration_for_this_device_conflicts_with_other_devices_ = 6

            Cannot_filter_ = 7

            The_driver_loader_for_the_device_is_missing_ = 8

            This_device_is_not_working_properly_because_the_controlling_firmware_is_reporting_the_resources_for_the_device_incorrectly_ = 9

            This_device_cannot_start_ = 10

            This_device_failed_ = 11

            This_device_cannot_find_enough_free_resources_that_it_can_use_ = 12

            Windows_cannot_verify_this_device_s_resources_ = 13

            This_device_cannot_work_properly_until_you_restart_your_computer_ = 14

            This_device_is_not_working_properly_because_there_is_probably_a_re_enumeration_problem_ = 15

            Windows_cannot_identify_all_the_resources_this_device_uses_ = 16

            This_device_is_asking_for_an_unknown_resource_type_ = 17

            Reinstall_the_drivers_for_this_device_ = 18

            Failure_using_the_VxD_loader_ = 19

            Your_registry_might_be_corrupted_ = 20

            System_failure_Try_changing_the_driver_for_this_device_If_that_does_not_work_see_your_hardware_documentation_Windows_is_removing_this_device_ = 21

            This_device_is_disabled_ = 22

            System_failure_Try_changing_the_driver_for_this_device_If_that_doesn_t_work_see_your_hardware_documentation_ = 23

            This_device_is_not_present_is_not_working_properly_or_does_not_have_all_its_drivers_installed_ = 24

            Windows_is_still_setting_up_this_device_ = 25

            Windows_is_still_setting_up_this_device_0 = 26

            This_device_does_not_have_valid_log_configuration_ = 27

            The_drivers_for_this_device_are_not_installed_ = 28

            This_device_is_disabled_because_the_firmware_of_the_device_did_not_give_it_the_required_resources_ = 29

            This_device_is_using_an_Interrupt_Request_IRQ_resource_that_another_device_is_using_ = 30

            This_device_is_not_working_properly_because_Windows_cannot_load_the_drivers_required_for_this_device_ = 31

            NULL_ENUM_VALUE = 32
        End Enum

        Public Enum DriveTypeValues

            Unknown0 = 0

            No_Root_Directory = 1

            Removable_Disk = 2

            Local_Disk = 3

            Network_Drive = 4

            Compact_Disc = 5

            RAM_Disk = 6

            NULL_ENUM_VALUE = 7
        End Enum

        Public Enum MediaTypeValues

            Format_is_unknown = 0

            Val_5_Inch_Floppy_Disk = 1

            Val_3_Inch_Floppy_Disk = 2

            Val_3_Inch_Floppy_Disk0 = 3

            Val_3_Inch_Floppy_Disk1 = 4

            Val_3_Inch_Floppy_Disk2 = 5

            Val_5_Inch_Floppy_Disk0 = 6

            Val_5_Inch_Floppy_Disk1 = 7

            Val_5_Inch_Floppy_Disk2 = 8

            Val_5_Inch_Floppy_Disk3 = 9

            Val_5_Inch_Floppy_Disk4 = 10

            Removable_media_other_than_floppy = 11

            Fixed_hard_disk_media = 12

            Val_3_Inch_Floppy_Disk3 = 13

            Val_3_Inch_Floppy_Disk4 = 14

            Val_5_Inch_Floppy_Disk5 = 15

            Val_5_Inch_Floppy_Disk6 = 16

            Val_3_Inch_Floppy_Disk5 = 17

            Val_3_Inch_Floppy_Disk6 = 18

            Val_5_Inch_Floppy_Disk7 = 19

            Val_3_Inch_Floppy_Disk7 = 20

            Val_3_Inch_Floppy_Disk8 = 21

            Val_8_Inch_Floppy_Disk = 22

            NULL_ENUM_VALUE = 23
        End Enum

        Public Enum PowerManagementCapabilitiesValues

            Unknown0 = 0

            Not_Supported = 1

            Disabled = 2

            Enabled = 3

            Power_Saving_Modes_Entered_Automatically = 4

            Power_State_Settable = 5

            Power_Cycling_Supported = 6

            Timed_Power_On_Supported = 7

            NULL_ENUM_VALUE = 8
        End Enum

        Public Enum StatusInfoValues

            Other0 = 1

            Unknown0 = 2

            Enabled = 3

            Disabled = 4

            Not_Applicable = 5

            NULL_ENUM_VALUE = 0
        End Enum

        'Enumerator implementation for enumerating instances of the class.
        Public Class LogicalDiskCollection
            Inherits Object
            Implements ICollection

            Private privColObj As ManagementObjectCollection

            Public Sub New(ByVal objCollection As ManagementObjectCollection)
                MyBase.New()
                privColObj = objCollection
            End Sub

            Public Overridable ReadOnly Property Count() As Integer Implements System.Collections.ICollection.Count
                Get
                    Return privColObj.Count
                End Get
            End Property

            Public Overridable ReadOnly Property IsSynchronized() As Boolean Implements System.Collections.ICollection.IsSynchronized
                Get
                    Return privColObj.IsSynchronized
                End Get
            End Property

            Public Overridable ReadOnly Property SyncRoot() As Object Implements System.Collections.ICollection.SyncRoot
                Get
                    Return Me
                End Get
            End Property

            Public Overridable Sub CopyTo(ByVal array As System.Array, ByVal index As Integer) Implements System.Collections.ICollection.CopyTo
                privColObj.CopyTo(array, index)
                Dim nCtr As Integer
                nCtr = 0
                Do While (nCtr < array.Length)
                    array.SetValue(New LogicalDisk(CType(array.GetValue(nCtr), System.Management.ManagementObject)), nCtr)
                    nCtr = (nCtr + 1)
                Loop
            End Sub

            Public Overridable Function GetEnumerator() As System.Collections.IEnumerator Implements System.Collections.IEnumerable.GetEnumerator
                Return New LogicalDiskEnumerator(privColObj.GetEnumerator)
            End Function

            Public Class LogicalDiskEnumerator
                Inherits Object
                Implements System.Collections.IEnumerator

                Private privObjEnum As ManagementObjectCollection.ManagementObjectEnumerator

                Public Sub New(ByVal objEnum As ManagementObjectCollection.ManagementObjectEnumerator)
                    MyBase.New()
                    privObjEnum = objEnum
                End Sub

                Public Overridable ReadOnly Property Current() As Object Implements System.Collections.IEnumerator.Current
                    Get
                        Return New LogicalDisk(CType(privObjEnum.Current, System.Management.ManagementObject))
                    End Get
                End Property

                Public Overridable Function MoveNext() As Boolean Implements System.Collections.IEnumerator.MoveNext
                    Return privObjEnum.MoveNext
                End Function

                Public Overridable Sub Reset() Implements System.Collections.IEnumerator.Reset
                    privObjEnum.Reset()
                End Sub
            End Class
        End Class

        'TypeConverter to handle null values for ValueType properties
        Public Class WMIValueTypeConverter
            Inherits TypeConverter

            Private baseConverter As TypeConverter

            Private baseType As System.Type

            Public Sub New(ByVal inBaseType As System.Type)
                MyBase.New()
                baseConverter = TypeDescriptor.GetConverter(inBaseType)
                baseType = inBaseType
            End Sub

            Public Overloads Overrides Function CanConvertFrom(ByVal context As System.ComponentModel.ITypeDescriptorContext, ByVal srcType As System.Type) As Boolean
                Return baseConverter.CanConvertFrom(context, srcType)
            End Function

            Public Overloads Overrides Function CanConvertTo(ByVal context As System.ComponentModel.ITypeDescriptorContext, ByVal destinationType As System.Type) As Boolean
                Return baseConverter.CanConvertTo(context, destinationType)
            End Function

            Public Overloads Overrides Function ConvertFrom(ByVal context As System.ComponentModel.ITypeDescriptorContext, ByVal culture As System.Globalization.CultureInfo, ByVal value As Object) As Object
                Return baseConverter.ConvertFrom(context, culture, value)
            End Function

            Public Overloads Overrides Function CreateInstance(ByVal context As System.ComponentModel.ITypeDescriptorContext, ByVal dictionary As System.Collections.IDictionary) As Object
                Return baseConverter.CreateInstance(context, dictionary)
            End Function

            Public Overloads Overrides Function GetCreateInstanceSupported(ByVal context As System.ComponentModel.ITypeDescriptorContext) As Boolean
                Return baseConverter.GetCreateInstanceSupported(context)
            End Function

            Public Overloads Overrides Function GetProperties(ByVal context As System.ComponentModel.ITypeDescriptorContext, ByVal value As Object, ByVal attributeVar() As System.Attribute) As PropertyDescriptorCollection
                Return baseConverter.GetProperties(context, value, attributeVar)
            End Function

            Public Overloads Overrides Function GetPropertiesSupported(ByVal context As System.ComponentModel.ITypeDescriptorContext) As Boolean
                Return baseConverter.GetPropertiesSupported(context)
            End Function

            Public Overloads Overrides Function GetStandardValues(ByVal context As System.ComponentModel.ITypeDescriptorContext) As System.ComponentModel.TypeConverter.StandardValuesCollection
                Return baseConverter.GetStandardValues(context)
            End Function

            Public Overloads Overrides Function GetStandardValuesExclusive(ByVal context As System.ComponentModel.ITypeDescriptorContext) As Boolean
                Return baseConverter.GetStandardValuesExclusive(context)
            End Function

            Public Overloads Overrides Function GetStandardValuesSupported(ByVal context As System.ComponentModel.ITypeDescriptorContext) As Boolean
                Return baseConverter.GetStandardValuesSupported(context)
            End Function

            Public Overloads Overrides Function ConvertTo(ByVal context As System.ComponentModel.ITypeDescriptorContext, ByVal culture As System.Globalization.CultureInfo, ByVal value As Object, ByVal destinationType As System.Type) As Object
                If (baseType.BaseType Is GetType(System.[Enum])) Then
                    If (value.GetType Is destinationType) Then
                        Return value
                    End If
                    If (((value = Nothing) _
                                AndAlso (Not (context) Is Nothing)) _
                                AndAlso (context.PropertyDescriptor.ShouldSerializeValue(context.Instance) = False)) Then
                        Return "NULL_ENUM_VALUE"
                    End If
                    Return baseConverter.ConvertTo(context, culture, value, destinationType)
                End If
                If ((baseType Is GetType(Boolean)) _
                            AndAlso (baseType.BaseType Is GetType(System.ValueType))) Then
                    If (((value = Nothing) _
                                AndAlso (Not (context) Is Nothing)) _
                                AndAlso (context.PropertyDescriptor.ShouldSerializeValue(context.Instance) = False)) Then
                        Return ""
                    End If
                    Return baseConverter.ConvertTo(context, culture, value, destinationType)
                End If
                If ((Not (context) Is Nothing) _
                            AndAlso (context.PropertyDescriptor.ShouldSerializeValue(context.Instance) = False)) Then
                    Return ""
                End If
                Return baseConverter.ConvertTo(context, culture, value, destinationType)
            End Function
        End Class

        'Embedded class to represent WMI system Properties.
        <TypeConverter(GetType(System.ComponentModel.ExpandableObjectConverter))> _
        Public Class ManagementSystemProperties

            Private PrivateLateBoundObject As System.Management.ManagementBaseObject

            Public Sub New(ByVal ManagedObject As System.Management.ManagementBaseObject)
                MyBase.New()
                PrivateLateBoundObject = ManagedObject
            End Sub

            <Browsable(True)> _
            Public ReadOnly Property GENUS() As Integer
                Get
                    Return CType(PrivateLateBoundObject("__GENUS"), Integer)
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property [CLASS]() As String
                Get
                    Return CType(PrivateLateBoundObject("__CLASS"), String)
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property SUPERCLASS() As String
                Get
                    Return CType(PrivateLateBoundObject("__SUPERCLASS"), String)
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property DYNASTY() As String
                Get
                    Return CType(PrivateLateBoundObject("__DYNASTY"), String)
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property RELPATH() As String
                Get
                    Return CType(PrivateLateBoundObject("__RELPATH"), String)
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property PROPERTY_COUNT() As Integer
                Get
                    Return CType(PrivateLateBoundObject("__PROPERTY_COUNT"), Integer)
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property DERIVATION() As String()
                Get
                    Return CType(PrivateLateBoundObject("__DERIVATION"), String())
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property SERVER() As String
                Get
                    Return CType(PrivateLateBoundObject("__SERVER"), String)
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property [NAMESPACE]() As String
                Get
                    Return CType(PrivateLateBoundObject("__NAMESPACE"), String)
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property PATH() As String
                Get
                    Return CType(PrivateLateBoundObject("__PATH"), String)
                End Get
            End Property
        End Class
    End Class

    'Functions ShouldSerialize<PropertyName> are functions used by VS property browser to check if a particular property has to be serialized. These functions are added for all ValueType properties ( properties of type Int32, BOOL etc.. which cannot be set to null). These functions use Is<PropertyName>Null function. These functions are also used in the TypeConverter implementation for the properties to check for NULL value of property so that an empty value can be shown in Property browser in case of Drag and Drop in Visual studio.
    'Functions Is<PropertyName>Null() are used to check if a property is NULL.
    'Functions Reset<PropertyName> are added for Nullable Read/Write properties. These functions are used by VS designer in property browser to set a property to NULL.
    'Every property added to the class for WMI property has attributes set to define its behavior in Visual Studio designer and also to define a TypeConverter to be used.
    'Datetime conversion functions ToDateTime and ToDmtfDateTime are added to the class to convert DMTF datetime to System.DateTime and vice-versa.
    'An Early Bound class generated for the WMI class.Win32_NetworkAdapter

    Public Class NetworkAdapter
        Inherits System.ComponentModel.Component

        'Private property to hold the WMI namespace in which the class resides.
        Private Shared CreatedWmiNamespace As String = "root\cimv2"

        'Private property to hold the name of WMI class which created this class.
        Private Shared CreatedClassName As String = "Win32_NetworkAdapter"

        'Private member variable to hold the ManagementScope which is used by the various methods.
        Private Shared statMgmtScope As System.Management.ManagementScope = Nothing

        Private PrivateSystemProperties As ManagementSystemProperties

        'Underlying lateBound WMI object.
        Private PrivateLateBoundObject As System.Management.ManagementObject

        'Member variable to store the 'automatic commit' behavior for the class.
        Private AutoCommitProp As Boolean

        'Private variable to hold the embedded property representing the instance.
        Private embeddedObj As System.Management.ManagementBaseObject

        'The current WMI object used
        Private curObj As System.Management.ManagementBaseObject

        'Flag to indicate if the instance is an embedded object.
        Private isEmbedded As Boolean

        'Below are different overloads of constructors to initialize an instance of the class with a WMI object.
        Public Sub New()
            MyBase.New()
            Me.InitializeObject(Nothing, Nothing, Nothing)
        End Sub

        Public Sub New(ByVal keyDeviceID As String)
            MyBase.New()
            Me.InitializeObject(Nothing, New System.Management.ManagementPath(NetworkAdapter.ConstructPath(keyDeviceID)), Nothing)
        End Sub

        Public Sub New(ByVal mgmtScope As System.Management.ManagementScope, ByVal keyDeviceID As String)
            MyBase.New()
            Me.InitializeObject(CType(mgmtScope, System.Management.ManagementScope), New System.Management.ManagementPath(NetworkAdapter.ConstructPath(keyDeviceID)), Nothing)
        End Sub

        Public Sub New(ByVal path As System.Management.ManagementPath, ByVal getOptions As System.Management.ObjectGetOptions)
            MyBase.New()
            Me.InitializeObject(Nothing, path, getOptions)
        End Sub

        Public Sub New(ByVal mgmtScope As System.Management.ManagementScope, ByVal path As System.Management.ManagementPath)
            MyBase.New()
            Me.InitializeObject(mgmtScope, path, Nothing)
        End Sub

        Public Sub New(ByVal path As System.Management.ManagementPath)
            MyBase.New()
            Me.InitializeObject(Nothing, path, Nothing)
        End Sub

        Public Sub New(ByVal mgmtScope As System.Management.ManagementScope, ByVal path As System.Management.ManagementPath, ByVal getOptions As System.Management.ObjectGetOptions)
            MyBase.New()
            Me.InitializeObject(mgmtScope, path, getOptions)
        End Sub

        Public Sub New(ByVal theObject As System.Management.ManagementObject)
            MyBase.New()
            Initialize()
            If (CheckIfProperClass(theObject) = True) Then
                PrivateLateBoundObject = theObject
                PrivateSystemProperties = New ManagementSystemProperties(PrivateLateBoundObject)
                curObj = PrivateLateBoundObject
            Else
                Throw New System.ArgumentException("Class name does not match.")
            End If
        End Sub

        Public Sub New(ByVal theObject As System.Management.ManagementBaseObject)
            MyBase.New()
            Initialize()
            If (CheckIfProperClass(theObject) = True) Then
                embeddedObj = theObject
                PrivateSystemProperties = New ManagementSystemProperties(theObject)
                curObj = embeddedObj
                isEmbedded = True
            Else
                Throw New System.ArgumentException("Class name does not match.")
            End If
        End Sub

        'Property returns the namespace of the WMI class.
        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property OriginatingNamespace() As String
            Get
                Return "root\cimv2"
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property ManagementClassName() As String
            Get
                Dim strRet As String = CreatedClassName
                If (Not (curObj) Is Nothing) Then
                    If (Not (curObj.ClassPath) Is Nothing) Then
                        strRet = CType(curObj("__CLASS"), String)
                        If ((strRet Is Nothing) _
                                    OrElse (strRet Is String.Empty)) Then
                            strRet = CreatedClassName
                        End If
                    End If
                End If
                Return strRet
            End Get
        End Property

        'Property pointing to an embedded object to get System properties of the WMI object.
        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property SystemProperties() As ManagementSystemProperties
            Get
                Return PrivateSystemProperties
            End Get
        End Property

        'Property returning the underlying lateBound object.
        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property LateBoundObject() As System.Management.ManagementBaseObject
            Get
                Return curObj
            End Get
        End Property

        'ManagementScope of the object.
        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public Property Scope() As System.Management.ManagementScope
            Get
                If (isEmbedded = False) Then
                    Return PrivateLateBoundObject.Scope
                Else
                    Return Nothing
                End If
            End Get
            Set(ByVal value As System.Management.ManagementScope)
                If (isEmbedded = False) Then
                    PrivateLateBoundObject.Scope = value
                End If
            End Set
        End Property

        'Property to show the commit behavior for the WMI object. If true, WMI object will be automatically saved after each property modification.(ie. Put() is called after modification of a property).
        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public Property AutoCommit() As Boolean
            Get
                Return AutoCommitProp
            End Get
            Set(ByVal value As Boolean)
                AutoCommitProp = value
            End Set
        End Property

        'The ManagementPath of the underlying WMI object.
        <Browsable(True)> _
        Public Property Path() As System.Management.ManagementPath
            Get
                If (isEmbedded = False) Then
                    Return PrivateLateBoundObject.Path
                Else
                    Return Nothing
                End If
            End Get
            Set(ByVal value As System.Management.ManagementPath)
                If (isEmbedded = False) Then
                    If (CheckIfProperClass(Nothing, value, Nothing) <> True) Then
                        Throw New System.ArgumentException("Class name does not match.")
                    End If
                    PrivateLateBoundObject.Path = value
                End If
            End Set
        End Property

        'Public static scope property which is used by the various methods.
        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public Shared Property StaticScope() As System.Management.ManagementScope
            Get
                Return statMgmtScope
            End Get
            Set(ByVal value As System.Management.ManagementScope)
                statMgmtScope = value
            End Set
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The AdapterType property reflects the network medium in use. This property may no" & _
            "t be applicable to all types of network adapters listed within this class. Windo" & _
            "ws NT only.")> _
        Public ReadOnly Property AdapterType() As String
            Get
                Return CType(curObj("AdapterType"), String)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsAdapterTypeIdNull() As Boolean
            Get
                If (curObj("AdapterTypeId") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The AdapterTypeId property reflects the network medium in use. This property give" & _
            "s the same information as the AdapterType property, except that the the informat" & _
            "ion is returned in the form of an integer value that corresponds to the followin" & _
            "g: " & Global.Microsoft.VisualBasic.ChrW(10) & "0 - Ethernet 802.3" & Global.Microsoft.VisualBasic.ChrW(10) & "1 - Token Ring 802.5" & Global.Microsoft.VisualBasic.ChrW(10) & "2 - Fiber Distributed Data Interface" & _
            " (FDDI)" & Global.Microsoft.VisualBasic.ChrW(10) & "3 - Wide Area Network (WAN)" & Global.Microsoft.VisualBasic.ChrW(10) & "4 - LocalTalk" & Global.Microsoft.VisualBasic.ChrW(10) & "5 - Ethernet using DIX header " & _
            "format" & Global.Microsoft.VisualBasic.ChrW(10) & "6 - ARCNET" & Global.Microsoft.VisualBasic.ChrW(10) & "7 - ARCNET (878.2)" & Global.Microsoft.VisualBasic.ChrW(10) & "8 - ATM" & Global.Microsoft.VisualBasic.ChrW(10) & "9 - Wireless" & Global.Microsoft.VisualBasic.ChrW(10) & "10 - Infrared Wireless" & _
            "" & Global.Microsoft.VisualBasic.ChrW(10) & "11 - Bpc" & Global.Microsoft.VisualBasic.ChrW(10) & "12 - CoWan" & Global.Microsoft.VisualBasic.ChrW(10) & "13 - 1394" & Global.Microsoft.VisualBasic.ChrW(10) & "This property may not be applicable to all types " & _
            "of network adapters listed within this class. Windows NT only."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property AdapterTypeId() As AdapterTypeIdValues
            Get
                If (curObj("AdapterTypeId") Is Nothing) Then
                    Return CType(System.Convert.ToInt32(14), AdapterTypeIdValues)
                End If
                Return CType(System.Convert.ToInt32(curObj("AdapterTypeId")), AdapterTypeIdValues)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsAutoSenseNull() As Boolean
            Get
                If (curObj("AutoSense") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("A boolean indicating whether the NetworkAdapter is capable of automatically deter" & _
            "mining the speed or other communications characteristics of the attached network" & _
            " media."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property AutoSense() As Boolean
            Get
                If (curObj("AutoSense") Is Nothing) Then
                    Return System.Convert.ToBoolean(0)
                End If
                Return CType(curObj("AutoSense"), Boolean)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsAvailabilityNull() As Boolean
            Get
                If (curObj("Availability") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The availability and status of the device.  For example, the Availability propert" & _
            "y indicates that the device is running and has full power (value=3), or is in a " & _
            "warning (4), test (5), degraded (10) or power save state (values 13-15 and 17). " & _
            "Regarding the power saving states, these are defined as follows: Value 13 (""Powe" & _
            "r Save - Unknown"") indicates that the device is known to be in a power save mode" & _
            ", but its exact status in this mode is unknown; 14 (""Power Save - Low Power Mode" & _
            """) indicates that the device is in a power save state but still functioning, and" & _
            " may exhibit degraded performance; 15 (""Power Save - Standby"") describes that th" & _
            "e device is not functioning but could be brought to full power 'quickly'; and va" & _
            "lue 17 (""Power Save - Warning"") indicates that the device is in a warning state," & _
            " though also in a power save mode."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property Availability() As AvailabilityValues
            Get
                If (curObj("Availability") Is Nothing) Then
                    Return CType(System.Convert.ToInt32(0), AvailabilityValues)
                End If
                Return CType(System.Convert.ToInt32(curObj("Availability")), AvailabilityValues)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The Caption property is a short textual description (one-line string) of the obje" & _
            "ct.")> _
        Public ReadOnly Property Caption() As String
            Get
                Return CType(curObj("Caption"), String)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsConfigManagerErrorCodeNull() As Boolean
            Get
                If (curObj("ConfigManagerErrorCode") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("Indicates the Win32 Configuration Manager error code.  The following values may b" & _
            "e returned: " & Global.Microsoft.VisualBasic.ChrW(10) & "0      This device is working properly. " & Global.Microsoft.VisualBasic.ChrW(10) & "1      This device is not " & _
            "configured correctly. " & Global.Microsoft.VisualBasic.ChrW(10) & "2      Windows cannot load the driver for this device. " & Global.Microsoft.VisualBasic.ChrW(10) & "3" & _
            "      The driver for this device might be corrupted, or your system may be runni" & _
            "ng low on memory or other resources. " & Global.Microsoft.VisualBasic.ChrW(10) & "4      This device is not working properly" & _
            ". One of its drivers or your registry might be corrupted. " & Global.Microsoft.VisualBasic.ChrW(10) & "5      The driver for" & _
            " this device needs a resource that Windows cannot manage. " & Global.Microsoft.VisualBasic.ChrW(10) & "6      The boot confi" & _
            "guration for this device conflicts with other devices. " & Global.Microsoft.VisualBasic.ChrW(10) & "7      Cannot filter. " & Global.Microsoft.VisualBasic.ChrW(10) & "8" & _
            "      The driver loader for the device is missing. " & Global.Microsoft.VisualBasic.ChrW(10) & "9      This device is not wo" & _
            "rking properly because the controlling firmware is reporting the resources for t" & _
            "he device incorrectly. " & Global.Microsoft.VisualBasic.ChrW(10) & "10     This device cannot start. " & Global.Microsoft.VisualBasic.ChrW(10) & "11     This device fai" & _
            "led. " & Global.Microsoft.VisualBasic.ChrW(10) & "12     This device cannot find enough free resources that it can use. " & Global.Microsoft.VisualBasic.ChrW(10) & "13 " & _
            "    Windows cannot verify this device's resources. " & Global.Microsoft.VisualBasic.ChrW(10) & "14     This device cannot wo" & _
            "rk properly until you restart your computer. " & Global.Microsoft.VisualBasic.ChrW(10) & "15     This device is not working " & _
            "properly because there is probably a re-enumeration problem. " & Global.Microsoft.VisualBasic.ChrW(10) & "16     Windows can" & _
            "not identify all the resources this device uses. " & Global.Microsoft.VisualBasic.ChrW(10) & "17     This device is asking f" & _
            "or an unknown resource type. " & Global.Microsoft.VisualBasic.ChrW(10) & "18     Reinstall the drivers for this device. " & Global.Microsoft.VisualBasic.ChrW(10) & "19 " & _
            "    Your registry might be corrupted. " & Global.Microsoft.VisualBasic.ChrW(10) & "20     Failure using the VxD loader. " & Global.Microsoft.VisualBasic.ChrW(10) & "21 " & _
            "    System failure: Try changing the driver for this device. If that does not wo" & _
            "rk, see your hardware documentation. Windows is removing this device. " & Global.Microsoft.VisualBasic.ChrW(10) & "22     Th" & _
            "is device is disabled. " & Global.Microsoft.VisualBasic.ChrW(10) & "23     System failure: Try changing the driver for this " & _
            "device. If that doesn't work, see your hardware documentation. " & Global.Microsoft.VisualBasic.ChrW(10) & "24     This devi" & _
            "ce is not present, is not working properly, or does not have all its drivers ins" & _
            "talled. " & Global.Microsoft.VisualBasic.ChrW(10) & "25     Windows is still setting up this device. " & Global.Microsoft.VisualBasic.ChrW(10) & "26     Windows is stil" & _
            "l setting up this device. " & Global.Microsoft.VisualBasic.ChrW(10) & "27     This device does not have valid log configurat" & _
            "ion. " & Global.Microsoft.VisualBasic.ChrW(10) & "28     The drivers for this device are not installed. " & Global.Microsoft.VisualBasic.ChrW(10) & "29     This device " & _
            "is disabled because the firmware of the device did not give it the required reso" & _
            "urces. " & Global.Microsoft.VisualBasic.ChrW(10) & "30     This device is using an Interrupt Request (IRQ) resource that ano" & _
            "ther device is using. " & Global.Microsoft.VisualBasic.ChrW(10) & "31     This device is not working properly because Window" & _
            "s cannot load the drivers required for this device."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property ConfigManagerErrorCode() As ConfigManagerErrorCodeValues
            Get
                If (curObj("ConfigManagerErrorCode") Is Nothing) Then
                    Return CType(System.Convert.ToInt32(32), ConfigManagerErrorCodeValues)
                End If
                Return CType(System.Convert.ToInt32(curObj("ConfigManagerErrorCode")), ConfigManagerErrorCodeValues)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsConfigManagerUserConfigNull() As Boolean
            Get
                If (curObj("ConfigManagerUserConfig") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("Indicates whether the device is using a user-defined configuration."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property ConfigManagerUserConfig() As Boolean
            Get
                If (curObj("ConfigManagerUserConfig") Is Nothing) Then
                    Return System.Convert.ToBoolean(0)
                End If
                Return CType(curObj("ConfigManagerUserConfig"), Boolean)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("CreationClassName indicates the name of the class or the subclass used in the cre" & _
            "ation of an instance. When used with the other key properties of this class, thi" & _
            "s property allows all instances of this class and its subclasses to be uniquely " & _
            "identified.")> _
        Public ReadOnly Property CreationClassName() As String
            Get
                Return CType(curObj("CreationClassName"), String)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The Description property provides a textual description of the object. ")> _
        Public ReadOnly Property Description() As String
            Get
                Return CType(curObj("Description"), String)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The DeviceID property contains a string uniquely identifying the network adapter " & _
            "from other devices on the system.")> _
        Public ReadOnly Property DeviceID() As String
            Get
                Return CType(curObj("DeviceID"), String)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsErrorClearedNull() As Boolean
            Get
                If (curObj("ErrorCleared") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("ErrorCleared is a boolean property indicating that the error reported in LastErro" & _
            "rCode property is now cleared."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property ErrorCleared() As Boolean
            Get
                If (curObj("ErrorCleared") Is Nothing) Then
                    Return System.Convert.ToBoolean(0)
                End If
                Return CType(curObj("ErrorCleared"), Boolean)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("ErrorDescription is a free-form string supplying more information about the error" & _
            " recorded in LastErrorCode property, and information on any corrective actions t" & _
            "hat may be taken.")> _
        Public ReadOnly Property ErrorDescription() As String
            Get
                Return CType(curObj("ErrorDescription"), String)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The GUID property specifies the Globally-unique identifier for the connection.")> _
        Public ReadOnly Property GUID() As String
            Get
                Return CType(curObj("GUID"), String)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsIndexNull() As Boolean
            Get
                If (curObj("Index") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The Index property indicates the network adapter's  index number, which is stored" & _
            " in the system registry. " & Global.Microsoft.VisualBasic.ChrW(10) & "Example: 0."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property Index() As UInteger
            Get
                If (curObj("Index") Is Nothing) Then
                    Return System.Convert.ToUInt32(0)
                End If
                Return CType(curObj("Index"), UInteger)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsInstallDateNull() As Boolean
            Get
                If (curObj("InstallDate") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The InstallDate property is datetime value indicating when the object was install" & _
            "ed. A lack of a value does not indicate that the object is not installed."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property InstallDate() As Date
            Get
                If (Not (curObj("InstallDate")) Is Nothing) Then
                    Return ToDateTime(CType(curObj("InstallDate"), String))
                Else
                    Return Date.MinValue
                End If
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsInstalledNull() As Boolean
            Get
                If (curObj("Installed") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The Installed property determines whether the network adapter is installed in the" & _
            " system." & Global.Microsoft.VisualBasic.ChrW(10) & "Values: TRUE or FALSE. A value of TRUE indicates the network adapter is" & _
            " installed.  " & Global.Microsoft.VisualBasic.ChrW(10) & "The Installed property has been deprecated.  There is no replaceme" & _
            "ntvalue and this property is now considered obsolete."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property Installed() As Boolean
            Get
                If (curObj("Installed") Is Nothing) Then
                    Return System.Convert.ToBoolean(0)
                End If
                Return CType(curObj("Installed"), Boolean)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsInterfaceIndexNull() As Boolean
            Get
                If (curObj("InterfaceIndex") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The InterfaceIndex property contains the index value that uniquely identifies the" & _
            " local interface."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property InterfaceIndex() As UInteger
            Get
                If (curObj("InterfaceIndex") Is Nothing) Then
                    Return System.Convert.ToUInt32(0)
                End If
                Return CType(curObj("InterfaceIndex"), UInteger)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsLastErrorCodeNull() As Boolean
            Get
                If (curObj("LastErrorCode") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("LastErrorCode captures the last error code reported by the logical device."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property LastErrorCode() As UInteger
            Get
                If (curObj("LastErrorCode") Is Nothing) Then
                    Return System.Convert.ToUInt32(0)
                End If
                Return CType(curObj("LastErrorCode"), UInteger)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The MACAddress property indicates the media access control address for this netwo" & _
            "rk adapter. A MAC address is a unique 48-bit number assigned to the network adap" & _
            "ter by the manufacturer. It uniquely identifies this network adapter and is used" & _
            " for mapping TCP/IP network communications.")> _
        Public ReadOnly Property MACAddress() As String
            Get
                Return CType(curObj("MACAddress"), String)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The Manufacturer property indicates the name of the network adapter's manufacture" & _
            "r." & Global.Microsoft.VisualBasic.ChrW(10) & "Example: 3COM.")> _
        Public ReadOnly Property Manufacturer() As String
            Get
                Return CType(curObj("Manufacturer"), String)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsMaxNumberControlledNull() As Boolean
            Get
                If (curObj("MaxNumberControlled") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The MaxNumberControlled property indicates the maximum number of directly address" & _
            "able ports supported by this network adapter. A value of zero should be used if " & _
            "the number is unknown."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property MaxNumberControlled() As UInteger
            Get
                If (curObj("MaxNumberControlled") Is Nothing) Then
                    Return System.Convert.ToUInt32(0)
                End If
                Return CType(curObj("MaxNumberControlled"), UInteger)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsMaxSpeedNull() As Boolean
            Get
                If (curObj("MaxSpeed") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The maximum speed, in bits per second, for the network adapter."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property MaxSpeed() As ULong
            Get
                If (curObj("MaxSpeed") Is Nothing) Then
                    Return System.Convert.ToUInt64(0)
                End If
                Return CType(curObj("MaxSpeed"), ULong)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The Name property defines the label by which the object is known. When subclassed" & _
            ", the Name property can be overridden to be a Key property.")> _
        Public ReadOnly Property Name() As String
            Get
                Return CType(curObj("Name"), String)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The NetConnectionID property specifies the name of the network connection as it a" & _
            "ppears in the 'Network Connections' folder.")> _
        Public Property NetConnectionID() As String
            Get
                Return CType(curObj("NetConnectionID"), String)
            End Get
            Set(ByVal value As String)
                curObj("NetConnectionID") = value
                If ((isEmbedded = False) _
                            AndAlso (AutoCommitProp = True)) Then
                    PrivateLateBoundObject.Put()
                End If
            End Set
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsNetConnectionStatusNull() As Boolean
            Get
                If (curObj("NetConnectionStatus") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("NetConnectionStatus is a string indicating the state of the network adapter's con" & _
            "nection to the network. The value of the property is to be interpreted as follow" & _
            "s:" & Global.Microsoft.VisualBasic.ChrW(10) & "0 - Disconnected" & Global.Microsoft.VisualBasic.ChrW(10) & "1 - Connecting" & Global.Microsoft.VisualBasic.ChrW(10) & "2 - Connected" & Global.Microsoft.VisualBasic.ChrW(10) & "3 - Disconnecting" & Global.Microsoft.VisualBasic.ChrW(10) & "4 - Hardware " & _
            "not present" & Global.Microsoft.VisualBasic.ChrW(10) & "5 - Hardware disabled" & Global.Microsoft.VisualBasic.ChrW(10) & "6 - Hardware malfunction" & Global.Microsoft.VisualBasic.ChrW(10) & "7 - Media disconnecte" & _
            "d" & Global.Microsoft.VisualBasic.ChrW(10) & "8 - Authenticating" & Global.Microsoft.VisualBasic.ChrW(10) & "9 - Authentication succeeded" & Global.Microsoft.VisualBasic.ChrW(10) & "10 - Authentication failed" & Global.Microsoft.VisualBasic.ChrW(10) & "11 " & _
            "- Invalid Address" & Global.Microsoft.VisualBasic.ChrW(10) & "12 - Credentials Required" & Global.Microsoft.VisualBasic.ChrW(10) & ".. - Other - For integer values othe" & _
            "r than those listed above, refer to Win32 error code documentation."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property NetConnectionStatus() As UShort
            Get
                If (curObj("NetConnectionStatus") Is Nothing) Then
                    Return System.Convert.ToUInt16(0)
                End If
                Return CType(curObj("NetConnectionStatus"), UShort)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsNetEnabledNull() As Boolean
            Get
                If (curObj("NetEnabled") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The NetEnabled property specifies whether the network connection is enabled or no" & _
            "t."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property NetEnabled() As Boolean
            Get
                If (curObj("NetEnabled") Is Nothing) Then
                    Return System.Convert.ToBoolean(0)
                End If
                Return CType(curObj("NetEnabled"), Boolean)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("An array of strings indicating the network addresses for an adapter.")> _
        Public ReadOnly Property NetworkAddresses() As String()
            Get
                Return CType(curObj("NetworkAddresses"), String())
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("PermanentAddress defines the network address hard coded into an adapter.  This 'h" & _
            "ard coded' address may be changed via firmware upgrade or software configuration" & _
            ". If so, this field should be updated when the change is made.  PermanentAddress" & _
            " should be left blank if no 'hard coded' address exists for the network adapter." & _
            "")> _
        Public ReadOnly Property PermanentAddress() As String
            Get
                Return CType(curObj("PermanentAddress"), String)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsPhysicalAdapterNull() As Boolean
            Get
                If (curObj("PhysicalAdapter") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The PhysicalAdapter property specifies whether the adapter is physical adapter or" & _
            " logical adapter."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property PhysicalAdapter() As Boolean
            Get
                If (curObj("PhysicalAdapter") Is Nothing) Then
                    Return System.Convert.ToBoolean(0)
                End If
                Return CType(curObj("PhysicalAdapter"), Boolean)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("Indicates the Win32 Plug and Play device ID of the logical device.  Example: *PNP" & _
            "030b")> _
        Public ReadOnly Property PNPDeviceID() As String
            Get
                Return CType(curObj("PNPDeviceID"), String)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("Indicates the specific power-related capabilities of the logical device. The arra" & _
            "y values, 0=""Unknown"", 1=""Not Supported"" and 2=""Disabled"" are self-explanatory. " & _
            "The value, 3=""Enabled"" indicates that the power management features are currentl" & _
            "y enabled but the exact feature set is unknown or the information is unavailable" & _
            ". ""Power Saving Modes Entered Automatically"" (4) describes that a device can cha" & _
            "nge its power state based on usage or other criteria. ""Power State Settable"" (5)" & _
            " indicates that the SetPowerState method is supported. ""Power Cycling Supported""" & _
            " (6) indicates that the SetPowerState method can be invoked with the PowerState " & _
            "input variable set to 5 (""Power Cycle""). ""Timed Power On Supported"" (7) indicate" & _
            "s that the SetPowerState method can be invoked with the PowerState input variabl" & _
            "e set to 5 (""Power Cycle"") and the Time parameter set to a specific date and tim" & _
            "e, or interval, for power-on.")> _
        Public ReadOnly Property PowerManagementCapabilities() As PowerManagementCapabilitiesValues()
            Get
                Dim arrEnumVals As System.Array = CType(curObj("PowerManagementCapabilities"), System.Array)
                Dim enumToRet((arrEnumVals.Length) - 1) As PowerManagementCapabilitiesValues
                Dim counter As Integer = 0
                counter = 0
                Do While (counter < arrEnumVals.Length)
                    enumToRet(counter) = CType(System.Convert.ToInt32(arrEnumVals.GetValue(counter)), PowerManagementCapabilitiesValues)
                    counter = (counter + 1)
                Loop
                Return enumToRet
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsPowerManagementSupportedNull() As Boolean
            Get
                If (curObj("PowerManagementSupported") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("Boolean indicating that the Device can be power managed - ie, put into a power sa" & _
            "ve state. This boolean does not indicate that power management features are curr" & _
            "ently enabled, or if enabled, what features are supported. Refer to the PowerMan" & _
            "agementCapabilities array for this information. If this boolean is false, the in" & _
            "teger value 1, for the string, ""Not Supported"", should be the only entry in the " & _
            "PowerManagementCapabilities array."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property PowerManagementSupported() As Boolean
            Get
                If (curObj("PowerManagementSupported") Is Nothing) Then
                    Return System.Convert.ToBoolean(0)
                End If
                Return CType(curObj("PowerManagementSupported"), Boolean)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The ProductName property indicates the product name of the network adapter." & Global.Microsoft.VisualBasic.ChrW(10) & "Examp" & _
            "le: Fast EtherLink XL")> _
        Public ReadOnly Property ProductName() As String
            Get
                Return CType(curObj("ProductName"), String)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The ServiceName property indicates the service name of the network adapter. This " & _
            "name is usually shorter that the full product name. " & Global.Microsoft.VisualBasic.ChrW(10) & "Example: Elnkii.")> _
        Public ReadOnly Property ServiceName() As String
            Get
                Return CType(curObj("ServiceName"), String)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsSpeedNull() As Boolean
            Get
                If (curObj("Speed") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("An estimate of the current bandwidth in bits per second. For endpoints which vary" & _
            " in bandwidth or for those where no accurate estimation can be made, this proper" & _
            "ty should contain the nominal bandwidth."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property Speed() As ULong
            Get
                If (curObj("Speed") Is Nothing) Then
                    Return System.Convert.ToUInt64(0)
                End If
                Return CType(curObj("Speed"), ULong)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The Status property is a string indicating the current status of the object. Vari" & _
            "ous operational and non-operational statuses can be defined. Operational statuse" & _
            "s are ""OK"", ""Degraded"" and ""Pred Fail"". ""Pred Fail"" indicates that an element ma" & _
            "y be functioning properly but predicting a failure in the near future. An exampl" & _
            "e is a SMART-enabled hard drive. Non-operational statuses can also be specified." & _
            " These are ""Error"", ""Starting"", ""Stopping"" and ""Service"". The latter, ""Service""," & _
            " could apply during mirror-resilvering of a disk, reload of a user permissions l" & _
            "ist, or other administrative work. Not all such work is on-line, yet the managed" & _
            " element is neither ""OK"" nor in one of the other states.")> _
        Public ReadOnly Property Status() As String
            Get
                Return CType(curObj("Status"), String)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsStatusInfoNull() As Boolean
            Get
                If (curObj("StatusInfo") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("StatusInfo is a string indicating whether the logical device is in an enabled (va" & _
            "lue = 3), disabled (value = 4) or some other (1) or unknown (2) state. If this p" & _
            "roperty does not apply to the logical device, the value, 5 (""Not Applicable""), s" & _
            "hould be used."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property StatusInfo() As StatusInfoValues
            Get
                If (curObj("StatusInfo") Is Nothing) Then
                    Return CType(System.Convert.ToInt32(0), StatusInfoValues)
                End If
                Return CType(System.Convert.ToInt32(curObj("StatusInfo")), StatusInfoValues)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The scoping System's CreationClassName.")> _
        Public ReadOnly Property SystemCreationClassName() As String
            Get
                Return CType(curObj("SystemCreationClassName"), String)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The scoping System's Name.")> _
        Public ReadOnly Property SystemName() As String
            Get
                Return CType(curObj("SystemName"), String)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsTimeOfLastResetNull() As Boolean
            Get
                If (curObj("TimeOfLastReset") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The TimeOfLastReset property indicates when the network adapter was last reset."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property TimeOfLastReset() As Date
            Get
                If (Not (curObj("TimeOfLastReset")) Is Nothing) Then
                    Return ToDateTime(CType(curObj("TimeOfLastReset"), String))
                Else
                    Return Date.MinValue
                End If
            End Get
        End Property

        Private Overloads Function CheckIfProperClass(ByVal mgmtScope As System.Management.ManagementScope, ByVal path As System.Management.ManagementPath, ByVal OptionsParam As System.Management.ObjectGetOptions) As Boolean
            If ((Not (path) Is Nothing) _
                        AndAlso (String.Compare(path.ClassName, Me.ManagementClassName, True, System.Globalization.CultureInfo.InvariantCulture) = 0)) Then
                Return True
            Else
                Return CheckIfProperClass(New System.Management.ManagementObject(mgmtScope, path, OptionsParam))
            End If
        End Function

        Private Overloads Function CheckIfProperClass(ByVal theObj As System.Management.ManagementBaseObject) As Boolean
            If ((Not (theObj) Is Nothing) _
                        AndAlso (String.Compare(CType(theObj("__CLASS"), String), Me.ManagementClassName, True, System.Globalization.CultureInfo.InvariantCulture) = 0)) Then
                Return True
            Else
                Dim parentClasses As System.Array = CType(theObj("__DERIVATION"), System.Array)
                If (Not (parentClasses) Is Nothing) Then
                    Dim count As Integer = 0
                    count = 0
                    Do While (count < parentClasses.Length)
                        If (String.Compare(CType(parentClasses.GetValue(count), String), Me.ManagementClassName, True, System.Globalization.CultureInfo.InvariantCulture) = 0) Then
                            Return True
                        End If
                        count = (count + 1)
                    Loop
                End If
            End If
            Return False
        End Function

        Private Function ShouldSerializeAdapterTypeId() As Boolean
            If (Me.IsAdapterTypeIdNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeAutoSense() As Boolean
            If (Me.IsAutoSenseNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeAvailability() As Boolean
            If (Me.IsAvailabilityNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeConfigManagerErrorCode() As Boolean
            If (Me.IsConfigManagerErrorCodeNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeConfigManagerUserConfig() As Boolean
            If (Me.IsConfigManagerUserConfigNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeErrorCleared() As Boolean
            If (Me.IsErrorClearedNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeIndex() As Boolean
            If (Me.IsIndexNull = False) Then
                Return True
            End If
            Return False
        End Function

        'Converts a given datetime in DMTF format to System.DateTime object.
        Shared Function ToDateTime(ByVal dmtfDate As String) As Date
            Dim initializer As Date = Date.MinValue
            Dim year As Integer = initializer.Year
            Dim month As Integer = initializer.Month
            Dim day As Integer = initializer.Day
            Dim hour As Integer = initializer.Hour
            Dim minute As Integer = initializer.Minute
            Dim second As Integer = initializer.Second
            Dim ticks As Long = 0
            Dim dmtf As String = dmtfDate
            Dim datetime As Date = Date.MinValue
            Dim tempString As String = String.Empty
            If (dmtf Is Nothing) Then
                Throw New System.ArgumentOutOfRangeException
            End If
            If (dmtf.Length = 0) Then
                Throw New System.ArgumentOutOfRangeException
            End If
            If (dmtf.Length <> 25) Then
                Throw New System.ArgumentOutOfRangeException
            End If
            Try
                tempString = dmtf.Substring(0, 4)
                If ("****" <> tempString) Then
                    year = Integer.Parse(tempString)
                End If
                tempString = dmtf.Substring(4, 2)
                If ("**" <> tempString) Then
                    month = Integer.Parse(tempString)
                End If
                tempString = dmtf.Substring(6, 2)
                If ("**" <> tempString) Then
                    day = Integer.Parse(tempString)
                End If
                tempString = dmtf.Substring(8, 2)
                If ("**" <> tempString) Then
                    hour = Integer.Parse(tempString)
                End If
                tempString = dmtf.Substring(10, 2)
                If ("**" <> tempString) Then
                    minute = Integer.Parse(tempString)
                End If
                tempString = dmtf.Substring(12, 2)
                If ("**" <> tempString) Then
                    second = Integer.Parse(tempString)
                End If
                tempString = dmtf.Substring(15, 6)
                If ("******" <> tempString) Then
                    ticks = (Long.Parse(tempString) * CType((System.TimeSpan.TicksPerMillisecond / 1000), Long))
                End If
                If ((((((((year < 0) _
                            OrElse (month < 0)) _
                            OrElse (day < 0)) _
                            OrElse (hour < 0)) _
                            OrElse (minute < 0)) _
                            OrElse (minute < 0)) _
                            OrElse (second < 0)) _
                            OrElse (ticks < 0)) Then
                    Throw New System.ArgumentOutOfRangeException
                End If
            Catch e As System.Exception
                Throw New System.ArgumentOutOfRangeException(Nothing, e.Message)
            End Try
            datetime = New Date(year, month, day, hour, minute, second, 0)
            datetime = datetime.AddTicks(ticks)
            Dim tickOffset As System.TimeSpan = System.TimeZone.CurrentTimeZone.GetUtcOffset(datetime)
            Dim UTCOffset As Integer = 0
            Dim OffsetToBeAdjusted As Integer = 0
            Dim OffsetMins As Long = CType((tickOffset.Ticks / System.TimeSpan.TicksPerMinute), Long)
            tempString = dmtf.Substring(22, 3)
            If (tempString <> "******") Then
                tempString = dmtf.Substring(21, 4)
                Try
                    UTCOffset = Integer.Parse(tempString)
                Catch e As System.Exception
                    Throw New System.ArgumentOutOfRangeException(Nothing, e.Message)
                End Try
                OffsetToBeAdjusted = CType((OffsetMins - UTCOffset), Integer)
                datetime = datetime.AddMinutes(CType(OffsetToBeAdjusted, Double))
            End If
            Return datetime
        End Function

        'Converts a given System.DateTime object to DMTF datetime format.
        Shared Function ToDmtfDateTime(ByVal [date] As Date) As String
            Dim utcString As String = String.Empty
            Dim tickOffset As System.TimeSpan = System.TimeZone.CurrentTimeZone.GetUtcOffset([date])
            Dim OffsetMins As Long = CType((tickOffset.Ticks / System.TimeSpan.TicksPerMinute), Long)
            If (System.Math.Abs(OffsetMins) > 999) Then
                [date] = [date].ToUniversalTime
                utcString = "+000"
            Else
                If (tickOffset.Ticks >= 0) Then
                    utcString = String.Concat("+", CType((tickOffset.Ticks / System.TimeSpan.TicksPerMinute), System.Int64).ToString.PadLeft(3, Global.Microsoft.VisualBasic.ChrW(48)))
                Else
                    Dim strTemp As String = CType(OffsetMins, System.Int64).ToString
                    utcString = String.Concat("-", strTemp.Substring(1, (strTemp.Length - 1)).PadLeft(3, Global.Microsoft.VisualBasic.ChrW(48)))
                End If
            End If
            Dim dmtfDateTime As String = CType([date].Year, System.Int32).ToString.PadLeft(4, Global.Microsoft.VisualBasic.ChrW(48))
            dmtfDateTime = String.Concat(dmtfDateTime, CType([date].Month, System.Int32).ToString.PadLeft(2, Global.Microsoft.VisualBasic.ChrW(48)))
            dmtfDateTime = String.Concat(dmtfDateTime, CType([date].Day, System.Int32).ToString.PadLeft(2, Global.Microsoft.VisualBasic.ChrW(48)))
            dmtfDateTime = String.Concat(dmtfDateTime, CType([date].Hour, System.Int32).ToString.PadLeft(2, Global.Microsoft.VisualBasic.ChrW(48)))
            dmtfDateTime = String.Concat(dmtfDateTime, CType([date].Minute, System.Int32).ToString.PadLeft(2, Global.Microsoft.VisualBasic.ChrW(48)))
            dmtfDateTime = String.Concat(dmtfDateTime, CType([date].Second, System.Int32).ToString.PadLeft(2, Global.Microsoft.VisualBasic.ChrW(48)))
            dmtfDateTime = String.Concat(dmtfDateTime, ".")
            Dim dtTemp As Date = New Date([date].Year, [date].Month, [date].Day, [date].Hour, [date].Minute, [date].Second, 0)
            Dim microsec As Long = CType(((([date].Ticks - dtTemp.Ticks) _
                        * 1000) _
                        / System.TimeSpan.TicksPerMillisecond), Long)
            Dim strMicrosec As String = CType(microsec, System.Int64).ToString
            If (strMicrosec.Length > 6) Then
                strMicrosec = strMicrosec.Substring(0, 6)
            End If
            dmtfDateTime = String.Concat(dmtfDateTime, strMicrosec.PadLeft(6, Global.Microsoft.VisualBasic.ChrW(48)))
            dmtfDateTime = String.Concat(dmtfDateTime, utcString)
            Return dmtfDateTime
        End Function

        Private Function ShouldSerializeInstallDate() As Boolean
            If (Me.IsInstallDateNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeInstalled() As Boolean
            If (Me.IsInstalledNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeInterfaceIndex() As Boolean
            If (Me.IsInterfaceIndexNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeLastErrorCode() As Boolean
            If (Me.IsLastErrorCodeNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeMaxNumberControlled() As Boolean
            If (Me.IsMaxNumberControlledNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeMaxSpeed() As Boolean
            If (Me.IsMaxSpeedNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Sub ResetNetConnectionID()
            curObj("NetConnectionID") = Nothing
            If ((isEmbedded = False) _
                        AndAlso (AutoCommitProp = True)) Then
                PrivateLateBoundObject.Put()
            End If
        End Sub

        Private Function ShouldSerializeNetConnectionStatus() As Boolean
            If (Me.IsNetConnectionStatusNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeNetEnabled() As Boolean
            If (Me.IsNetEnabledNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializePhysicalAdapter() As Boolean
            If (Me.IsPhysicalAdapterNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializePowerManagementSupported() As Boolean
            If (Me.IsPowerManagementSupportedNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeSpeed() As Boolean
            If (Me.IsSpeedNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeStatusInfo() As Boolean
            If (Me.IsStatusInfoNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeTimeOfLastReset() As Boolean
            If (Me.IsTimeOfLastResetNull = False) Then
                Return True
            End If
            Return False
        End Function

        <Browsable(True)> _
        Public Overloads Sub CommitObject()
            If (isEmbedded = False) Then
                PrivateLateBoundObject.Put()
            End If
        End Sub

        <Browsable(True)> _
        Public Overloads Sub CommitObject(ByVal putOptions As System.Management.PutOptions)
            If (isEmbedded = False) Then
                PrivateLateBoundObject.Put(putOptions)
            End If
        End Sub

        Private Sub Initialize()
            AutoCommitProp = True
            isEmbedded = False
        End Sub

        Private Shared Function ConstructPath(ByVal keyDeviceID As String) As String
            Dim strPath As String = "root\cimv2:Win32_NetworkAdapter"
            strPath = String.Concat(strPath, String.Concat(".DeviceID=", String.Concat("""", String.Concat(keyDeviceID, """"))))
            Return strPath
        End Function

        Private Sub InitializeObject(ByVal mgmtScope As System.Management.ManagementScope, ByVal path As System.Management.ManagementPath, ByVal getOptions As System.Management.ObjectGetOptions)
            Initialize()
            If (Not (path) Is Nothing) Then
                If (CheckIfProperClass(mgmtScope, path, getOptions) <> True) Then
                    Throw New System.ArgumentException("Class name does not match.")
                End If
            End If
            PrivateLateBoundObject = New System.Management.ManagementObject(mgmtScope, path, getOptions)
            PrivateSystemProperties = New ManagementSystemProperties(PrivateLateBoundObject)
            curObj = PrivateLateBoundObject
        End Sub

        'Different overloads of GetInstances() help in enumerating instances of the WMI class.
        Public Overloads Shared Function GetInstances() As NetworkAdapterCollection
            Return GetInstances(Nothing, Nothing, Nothing)
        End Function

        Public Overloads Shared Function GetInstances(ByVal condition As String) As NetworkAdapterCollection
            Return GetInstances(Nothing, condition, Nothing)
        End Function

        Public Overloads Shared Function GetInstances(ByVal selectedProperties() As System.String) As NetworkAdapterCollection
            Return GetInstances(Nothing, Nothing, selectedProperties)
        End Function

        Public Overloads Shared Function GetInstances(ByVal condition As String, ByVal selectedProperties() As System.String) As NetworkAdapterCollection
            Return GetInstances(Nothing, condition, selectedProperties)
        End Function

        Public Overloads Shared Function GetInstances(ByVal mgmtScope As System.Management.ManagementScope, ByVal enumOptions As System.Management.EnumerationOptions) As NetworkAdapterCollection
            If (mgmtScope Is Nothing) Then
                If (statMgmtScope Is Nothing) Then
                    mgmtScope = New System.Management.ManagementScope
                    mgmtScope.Path.NamespacePath = "root\cimv2"
                Else
                    mgmtScope = statMgmtScope
                End If
            End If
            Dim pathObj As System.Management.ManagementPath = New System.Management.ManagementPath
            pathObj.ClassName = "Win32_NetworkAdapter"
            pathObj.NamespacePath = "root\cimv2"
            Dim clsObject As System.Management.ManagementClass = New System.Management.ManagementClass(mgmtScope, pathObj, Nothing)
            If (enumOptions Is Nothing) Then
                enumOptions = New System.Management.EnumerationOptions
                enumOptions.EnsureLocatable = True
            End If
            Return New NetworkAdapterCollection(clsObject.GetInstances(enumOptions))
        End Function

        Public Overloads Shared Function GetInstances(ByVal mgmtScope As System.Management.ManagementScope, ByVal condition As String) As NetworkAdapterCollection
            Return GetInstances(mgmtScope, condition, Nothing)
        End Function

        Public Overloads Shared Function GetInstances(ByVal mgmtScope As System.Management.ManagementScope, ByVal selectedProperties() As System.String) As NetworkAdapterCollection
            Return GetInstances(mgmtScope, Nothing, selectedProperties)
        End Function

        Public Overloads Shared Function GetInstances(ByVal mgmtScope As System.Management.ManagementScope, ByVal condition As String, ByVal selectedProperties() As System.String) As NetworkAdapterCollection
            If (mgmtScope Is Nothing) Then
                If (statMgmtScope Is Nothing) Then
                    mgmtScope = New System.Management.ManagementScope
                    mgmtScope.Path.NamespacePath = "root\cimv2"
                Else
                    mgmtScope = statMgmtScope
                End If
            End If
            Dim ObjectSearcher As System.Management.ManagementObjectSearcher = New System.Management.ManagementObjectSearcher(mgmtScope, New SelectQuery("Win32_NetworkAdapter", condition, selectedProperties))
            Dim enumOptions As System.Management.EnumerationOptions = New System.Management.EnumerationOptions
            enumOptions.EnsureLocatable = True
            ObjectSearcher.Options = enumOptions
            Return New NetworkAdapterCollection(ObjectSearcher.Get)
        End Function

        <Browsable(True)> _
        Public Shared Function CreateInstance() As NetworkAdapter
            Dim mgmtScope As System.Management.ManagementScope = Nothing
            If (statMgmtScope Is Nothing) Then
                mgmtScope = New System.Management.ManagementScope
                mgmtScope.Path.NamespacePath = CreatedWmiNamespace
            Else
                mgmtScope = statMgmtScope
            End If
            Dim mgmtPath As System.Management.ManagementPath = New System.Management.ManagementPath(CreatedClassName)
            Dim tmpMgmtClass As System.Management.ManagementClass = New System.Management.ManagementClass(mgmtScope, mgmtPath, Nothing)
            Return New NetworkAdapter(tmpMgmtClass.CreateInstance)
        End Function

        <Browsable(True)> _
        Public Sub Delete()
            PrivateLateBoundObject.Delete()
        End Sub

        Public Function Disable() As UInteger
            If (isEmbedded = False) Then
                Dim inParams As System.Management.ManagementBaseObject = Nothing
                Dim outParams As System.Management.ManagementBaseObject = PrivateLateBoundObject.InvokeMethod("Disable", inParams, Nothing)
                Return System.Convert.ToUInt32(outParams.Properties("ReturnValue").Value)
            Else
                Return System.Convert.ToUInt32(0)
            End If
        End Function

        Public Function Enable() As UInteger
            If (isEmbedded = False) Then
                Dim inParams As System.Management.ManagementBaseObject = Nothing
                Dim outParams As System.Management.ManagementBaseObject = PrivateLateBoundObject.InvokeMethod("Enable", inParams, Nothing)
                Return System.Convert.ToUInt32(outParams.Properties("ReturnValue").Value)
            Else
                Return System.Convert.ToUInt32(0)
            End If
        End Function

        Public Function Reset() As UInteger
            If (isEmbedded = False) Then
                Dim inParams As System.Management.ManagementBaseObject = Nothing
                Dim outParams As System.Management.ManagementBaseObject = PrivateLateBoundObject.InvokeMethod("Reset", inParams, Nothing)
                Return System.Convert.ToUInt32(outParams.Properties("ReturnValue").Value)
            Else
                Return System.Convert.ToUInt32(0)
            End If
        End Function

        Public Function SetPowerState(ByVal PowerState As UShort, ByVal Time As Date) As UInteger
            If (isEmbedded = False) Then
                Dim inParams As System.Management.ManagementBaseObject = Nothing
                inParams = PrivateLateBoundObject.GetMethodParameters("SetPowerState")
                inParams("PowerState") = CType(PowerState, System.UInt16)
                inParams("Time") = ToDmtfDateTime(CType(Time, Date))
                Dim outParams As System.Management.ManagementBaseObject = PrivateLateBoundObject.InvokeMethod("SetPowerState", inParams, Nothing)
                Return System.Convert.ToUInt32(outParams.Properties("ReturnValue").Value)
            Else
                Return System.Convert.ToUInt32(0)
            End If
        End Function

        Public Enum AdapterTypeIdValues

            Ethernet_802_3 = 0

            Token_Ring_802_5 = 1

            Fiber_Distributed_Data_Interface_FDDI_ = 2

            Wide_Area_Network_WAN_ = 3

            LocalTalk = 4

            Ethernet_using_DIX_header_format = 5

            ARCNET = 6

            ARCNET_878_2_ = 7

            ATM = 8

            Wireless = 9

            Infrared_Wireless = 10

            Bpc = 11

            CoWan = 12

            Val_1394 = 13

            NULL_ENUM_VALUE = 14
        End Enum

        Public Enum AvailabilityValues

            Other0 = 1

            Unknown0 = 2

            Running_Full_Power = 3

            Warning = 4

            In_Test = 5

            Not_Applicable = 6

            Power_Off = 7

            Off_Line = 8

            Off_Duty = 9

            Degraded = 10

            Not_Installed = 11

            Install_Error = 12

            Power_Save_Unknown = 13

            Power_Save_Low_Power_Mode = 14

            Power_Save_Standby = 15

            Power_Cycle = 16

            Power_Save_Warning = 17

            Paused = 18

            Not_Ready = 19

            Not_Configured = 20

            Quiesced = 21

            NULL_ENUM_VALUE = 0
        End Enum

        Public Enum ConfigManagerErrorCodeValues

            This_device_is_working_properly_ = 0

            This_device_is_not_configured_correctly_ = 1

            Windows_cannot_load_the_driver_for_this_device_ = 2

            The_driver_for_this_device_might_be_corrupted_or_your_system_may_be_running_low_on_memory_or_other_resources_ = 3

            This_device_is_not_working_properly_One_of_its_drivers_or_your_registry_might_be_corrupted_ = 4

            The_driver_for_this_device_needs_a_resource_that_Windows_cannot_manage_ = 5

            The_boot_configuration_for_this_device_conflicts_with_other_devices_ = 6

            Cannot_filter_ = 7

            The_driver_loader_for_the_device_is_missing_ = 8

            This_device_is_not_working_properly_because_the_controlling_firmware_is_reporting_the_resources_for_the_device_incorrectly_ = 9

            This_device_cannot_start_ = 10

            This_device_failed_ = 11

            This_device_cannot_find_enough_free_resources_that_it_can_use_ = 12

            Windows_cannot_verify_this_device_s_resources_ = 13

            This_device_cannot_work_properly_until_you_restart_your_computer_ = 14

            This_device_is_not_working_properly_because_there_is_probably_a_re_enumeration_problem_ = 15

            Windows_cannot_identify_all_the_resources_this_device_uses_ = 16

            This_device_is_asking_for_an_unknown_resource_type_ = 17

            Reinstall_the_drivers_for_this_device_ = 18

            Failure_using_the_VxD_loader_ = 19

            Your_registry_might_be_corrupted_ = 20

            System_failure_Try_changing_the_driver_for_this_device_If_that_does_not_work_see_your_hardware_documentation_Windows_is_removing_this_device_ = 21

            This_device_is_disabled_ = 22

            System_failure_Try_changing_the_driver_for_this_device_If_that_doesn_t_work_see_your_hardware_documentation_ = 23

            This_device_is_not_present_is_not_working_properly_or_does_not_have_all_its_drivers_installed_ = 24

            Windows_is_still_setting_up_this_device_ = 25

            Windows_is_still_setting_up_this_device_0 = 26

            This_device_does_not_have_valid_log_configuration_ = 27

            The_drivers_for_this_device_are_not_installed_ = 28

            This_device_is_disabled_because_the_firmware_of_the_device_did_not_give_it_the_required_resources_ = 29

            This_device_is_using_an_Interrupt_Request_IRQ_resource_that_another_device_is_using_ = 30

            This_device_is_not_working_properly_because_Windows_cannot_load_the_drivers_required_for_this_device_ = 31

            NULL_ENUM_VALUE = 32
        End Enum

        Public Enum PowerManagementCapabilitiesValues

            Unknown0 = 0

            Not_Supported = 1

            Disabled = 2

            Enabled = 3

            Power_Saving_Modes_Entered_Automatically = 4

            Power_State_Settable = 5

            Power_Cycling_Supported = 6

            Timed_Power_On_Supported = 7

            NULL_ENUM_VALUE = 8
        End Enum

        Public Enum StatusInfoValues

            Other0 = 1

            Unknown0 = 2

            Enabled = 3

            Disabled = 4

            Not_Applicable = 5

            NULL_ENUM_VALUE = 0
        End Enum

        'Enumerator implementation for enumerating instances of the class.
        Public Class NetworkAdapterCollection
            Inherits Object
            Implements ICollection

            Private privColObj As ManagementObjectCollection

            Public Sub New(ByVal objCollection As ManagementObjectCollection)
                MyBase.New()
                privColObj = objCollection
            End Sub

            Public Overridable ReadOnly Property Count() As Integer Implements System.Collections.ICollection.Count
                Get
                    Return privColObj.Count
                End Get
            End Property

            Public Overridable ReadOnly Property IsSynchronized() As Boolean Implements System.Collections.ICollection.IsSynchronized
                Get
                    Return privColObj.IsSynchronized
                End Get
            End Property

            Public Overridable ReadOnly Property SyncRoot() As Object Implements System.Collections.ICollection.SyncRoot
                Get
                    Return Me
                End Get
            End Property

            Public Overridable Sub CopyTo(ByVal array As System.Array, ByVal index As Integer) Implements System.Collections.ICollection.CopyTo
                privColObj.CopyTo(array, index)
                Dim nCtr As Integer
                nCtr = 0
                Do While (nCtr < array.Length)
                    array.SetValue(New NetworkAdapter(CType(array.GetValue(nCtr), System.Management.ManagementObject)), nCtr)
                    nCtr = (nCtr + 1)
                Loop
            End Sub

            Public Overridable Function GetEnumerator() As System.Collections.IEnumerator Implements System.Collections.IEnumerable.GetEnumerator
                Return New NetworkAdapterEnumerator(privColObj.GetEnumerator)
            End Function

            Public Class NetworkAdapterEnumerator
                Inherits Object
                Implements System.Collections.IEnumerator

                Private privObjEnum As ManagementObjectCollection.ManagementObjectEnumerator

                Public Sub New(ByVal objEnum As ManagementObjectCollection.ManagementObjectEnumerator)
                    MyBase.New()
                    privObjEnum = objEnum
                End Sub

                Public Overridable ReadOnly Property Current() As Object Implements System.Collections.IEnumerator.Current
                    Get
                        Return New NetworkAdapter(CType(privObjEnum.Current, System.Management.ManagementObject))
                    End Get
                End Property

                Public Overridable Function MoveNext() As Boolean Implements System.Collections.IEnumerator.MoveNext
                    Return privObjEnum.MoveNext
                End Function

                Public Overridable Sub Reset() Implements System.Collections.IEnumerator.Reset
                    privObjEnum.Reset()
                End Sub
            End Class
        End Class

        'TypeConverter to handle null values for ValueType properties
        Public Class WMIValueTypeConverter
            Inherits TypeConverter

            Private baseConverter As TypeConverter

            Private baseType As System.Type

            Public Sub New(ByVal inBaseType As System.Type)
                MyBase.New()
                baseConverter = TypeDescriptor.GetConverter(inBaseType)
                baseType = inBaseType
            End Sub

            Public Overloads Overrides Function CanConvertFrom(ByVal context As System.ComponentModel.ITypeDescriptorContext, ByVal srcType As System.Type) As Boolean
                Return baseConverter.CanConvertFrom(context, srcType)
            End Function

            Public Overloads Overrides Function CanConvertTo(ByVal context As System.ComponentModel.ITypeDescriptorContext, ByVal destinationType As System.Type) As Boolean
                Return baseConverter.CanConvertTo(context, destinationType)
            End Function

            Public Overloads Overrides Function ConvertFrom(ByVal context As System.ComponentModel.ITypeDescriptorContext, ByVal culture As System.Globalization.CultureInfo, ByVal value As Object) As Object
                Return baseConverter.ConvertFrom(context, culture, value)
            End Function

            Public Overloads Overrides Function CreateInstance(ByVal context As System.ComponentModel.ITypeDescriptorContext, ByVal dictionary As System.Collections.IDictionary) As Object
                Return baseConverter.CreateInstance(context, dictionary)
            End Function

            Public Overloads Overrides Function GetCreateInstanceSupported(ByVal context As System.ComponentModel.ITypeDescriptorContext) As Boolean
                Return baseConverter.GetCreateInstanceSupported(context)
            End Function

            Public Overloads Overrides Function GetProperties(ByVal context As System.ComponentModel.ITypeDescriptorContext, ByVal value As Object, ByVal attributeVar() As System.Attribute) As PropertyDescriptorCollection
                Return baseConverter.GetProperties(context, value, attributeVar)
            End Function

            Public Overloads Overrides Function GetPropertiesSupported(ByVal context As System.ComponentModel.ITypeDescriptorContext) As Boolean
                Return baseConverter.GetPropertiesSupported(context)
            End Function

            Public Overloads Overrides Function GetStandardValues(ByVal context As System.ComponentModel.ITypeDescriptorContext) As System.ComponentModel.TypeConverter.StandardValuesCollection
                Return baseConverter.GetStandardValues(context)
            End Function

            Public Overloads Overrides Function GetStandardValuesExclusive(ByVal context As System.ComponentModel.ITypeDescriptorContext) As Boolean
                Return baseConverter.GetStandardValuesExclusive(context)
            End Function

            Public Overloads Overrides Function GetStandardValuesSupported(ByVal context As System.ComponentModel.ITypeDescriptorContext) As Boolean
                Return baseConverter.GetStandardValuesSupported(context)
            End Function

            Public Overloads Overrides Function ConvertTo(ByVal context As System.ComponentModel.ITypeDescriptorContext, ByVal culture As System.Globalization.CultureInfo, ByVal value As Object, ByVal destinationType As System.Type) As Object
                If (baseType.BaseType Is GetType(System.[Enum])) Then
                    If (value.GetType Is destinationType) Then
                        Return value
                    End If
                    If (((value = Nothing) _
                                AndAlso (Not (context) Is Nothing)) _
                                AndAlso (context.PropertyDescriptor.ShouldSerializeValue(context.Instance) = False)) Then
                        Return "NULL_ENUM_VALUE"
                    End If
                    Return baseConverter.ConvertTo(context, culture, value, destinationType)
                End If
                If ((baseType Is GetType(Boolean)) _
                            AndAlso (baseType.BaseType Is GetType(System.ValueType))) Then
                    If (((value = Nothing) _
                                AndAlso (Not (context) Is Nothing)) _
                                AndAlso (context.PropertyDescriptor.ShouldSerializeValue(context.Instance) = False)) Then
                        Return ""
                    End If
                    Return baseConverter.ConvertTo(context, culture, value, destinationType)
                End If
                If ((Not (context) Is Nothing) _
                            AndAlso (context.PropertyDescriptor.ShouldSerializeValue(context.Instance) = False)) Then
                    Return ""
                End If
                Return baseConverter.ConvertTo(context, culture, value, destinationType)
            End Function
        End Class

        'Embedded class to represent WMI system Properties.
        <TypeConverter(GetType(System.ComponentModel.ExpandableObjectConverter))> _
        Public Class ManagementSystemProperties

            Private PrivateLateBoundObject As System.Management.ManagementBaseObject

            Public Sub New(ByVal ManagedObject As System.Management.ManagementBaseObject)
                MyBase.New()
                PrivateLateBoundObject = ManagedObject
            End Sub

            <Browsable(True)> _
            Public ReadOnly Property GENUS() As Integer
                Get
                    Return CType(PrivateLateBoundObject("__GENUS"), Integer)
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property [CLASS]() As String
                Get
                    Return CType(PrivateLateBoundObject("__CLASS"), String)
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property SUPERCLASS() As String
                Get
                    Return CType(PrivateLateBoundObject("__SUPERCLASS"), String)
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property DYNASTY() As String
                Get
                    Return CType(PrivateLateBoundObject("__DYNASTY"), String)
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property RELPATH() As String
                Get
                    Return CType(PrivateLateBoundObject("__RELPATH"), String)
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property PROPERTY_COUNT() As Integer
                Get
                    Return CType(PrivateLateBoundObject("__PROPERTY_COUNT"), Integer)
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property DERIVATION() As String()
                Get
                    Return CType(PrivateLateBoundObject("__DERIVATION"), String())
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property SERVER() As String
                Get
                    Return CType(PrivateLateBoundObject("__SERVER"), String)
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property [NAMESPACE]() As String
                Get
                    Return CType(PrivateLateBoundObject("__NAMESPACE"), String)
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property PATH() As String
                Get
                    Return CType(PrivateLateBoundObject("__PATH"), String)
                End Get
            End Property
        End Class
    End Class

    'Functions ShouldSerialize<PropertyName> are functions used by VS property browser to check if a particular property has to be serialized. These functions are added for all ValueType properties ( properties of type Int32, BOOL etc.. which cannot be set to null). These functions use Is<PropertyName>Null function. These functions are also used in the TypeConverter implementation for the properties to check for NULL value of property so that an empty value can be shown in Property browser in case of Drag and Drop in Visual studio.
    'Functions Is<PropertyName>Null() are used to check if a property is NULL.
    'Functions Reset<PropertyName> are added for Nullable Read/Write properties. These functions are used by VS designer in property browser to set a property to NULL.
    'Every property added to the class for WMI property has attributes set to define its behavior in Visual Studio designer and also to define a TypeConverter to be used.
    'Datetime conversion functions ToDateTime and ToDmtfDateTime are added to the class to convert DMTF datetime to System.DateTime and vice-versa.
    'An Early Bound class generated for the WMI class.Win32_NetworkAdapterConfiguration
    Public Class NetworkAdapterConfiguration
        Inherits System.ComponentModel.Component


#Region "create"
        'Private property to hold the WMI namespace in which the class resides.
        Private Shared CreatedWmiNamespace As String = "root\cimv2"

        'Private property to hold the name of WMI class which created this class.
        Private Shared CreatedClassName As String = "Win32_NetworkAdapterConfiguration"

        'Private member variable to hold the ManagementScope which is used by the various methods.
        Private Shared statMgmtScope As System.Management.ManagementScope = Nothing

        Private PrivateSystemProperties As ManagementSystemProperties

        'Underlying lateBound WMI object.
        Private PrivateLateBoundObject As System.Management.ManagementObject

        'Member variable to store the 'automatic commit' behavior for the class.
        Private AutoCommitProp As Boolean

        'Private variable to hold the embedded property representing the instance.
        Private embeddedObj As System.Management.ManagementBaseObject

        'The current WMI object used
        Private curObj As System.Management.ManagementBaseObject

        'Flag to indicate if the instance is an embedded object.
        Private isEmbedded As Boolean

        'Below are different overloads of constructors to initialize an instance of the class with a WMI object.
        Public Sub New()
            MyBase.New()
            Me.InitializeObject(Nothing, Nothing, Nothing)
        End Sub

        Public Sub New(ByVal keyIndex As UInteger)
            MyBase.New()
            Me.InitializeObject(Nothing, New System.Management.ManagementPath(NetworkAdapterConfiguration.ConstructPath(keyIndex)), Nothing)
        End Sub

        Public Sub New(ByVal mgmtScope As System.Management.ManagementScope, ByVal keyIndex As UInteger)
            MyBase.New()
            Me.InitializeObject(CType(mgmtScope, System.Management.ManagementScope), New System.Management.ManagementPath(NetworkAdapterConfiguration.ConstructPath(keyIndex)), Nothing)
        End Sub

        Public Sub New(ByVal path As System.Management.ManagementPath, ByVal getOptions As System.Management.ObjectGetOptions)
            MyBase.New()
            Me.InitializeObject(Nothing, path, getOptions)
        End Sub

        Public Sub New(ByVal mgmtScope As System.Management.ManagementScope, ByVal path As System.Management.ManagementPath)
            MyBase.New()
            Me.InitializeObject(mgmtScope, path, Nothing)
        End Sub

        Public Sub New(ByVal path As System.Management.ManagementPath)
            MyBase.New()
            Me.InitializeObject(Nothing, path, Nothing)
        End Sub

        Public Sub New(ByVal mgmtScope As System.Management.ManagementScope, ByVal path As System.Management.ManagementPath, ByVal getOptions As System.Management.ObjectGetOptions)
            MyBase.New()
            Me.InitializeObject(mgmtScope, path, getOptions)
        End Sub

        Public Sub New(ByVal theObject As System.Management.ManagementObject)
            MyBase.New()
            Initialize()
            If (CheckIfProperClass(theObject) = True) Then
                PrivateLateBoundObject = theObject
                PrivateSystemProperties = New ManagementSystemProperties(PrivateLateBoundObject)
                curObj = PrivateLateBoundObject
            Else
                Throw New System.ArgumentException("Class name does not match.")
            End If
        End Sub

        Public Sub New(ByVal theObject As System.Management.ManagementBaseObject)
            MyBase.New()
            Initialize()
            If (CheckIfProperClass(theObject) = True) Then
                embeddedObj = theObject
                PrivateSystemProperties = New ManagementSystemProperties(theObject)
                curObj = embeddedObj
                isEmbedded = True
            Else
                Throw New System.ArgumentException("Class name does not match.")
            End If
        End Sub

        'Property returns the namespace of the WMI class.
        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property OriginatingNamespace() As String
            Get
                Return "root\cimv2"
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property ManagementClassName() As String
            Get
                Dim strRet As String = CreatedClassName
                If (Not (curObj) Is Nothing) Then
                    If (Not (curObj.ClassPath) Is Nothing) Then
                        strRet = CType(curObj("__CLASS"), String)
                        If ((strRet Is Nothing) _
                                    OrElse (strRet Is String.Empty)) Then
                            strRet = CreatedClassName
                        End If
                    End If
                End If
                Return strRet
            End Get
        End Property

        'Property pointing to an embedded object to get System properties of the WMI object.
        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property SystemProperties() As ManagementSystemProperties
            Get
                Return PrivateSystemProperties
            End Get
        End Property

        'Property returning the underlying lateBound object.
        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property LateBoundObject() As System.Management.ManagementBaseObject
            Get
                Return curObj
            End Get
        End Property

        'ManagementScope of the object.
        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public Property Scope() As System.Management.ManagementScope
            Get
                If (isEmbedded = False) Then
                    Return PrivateLateBoundObject.Scope
                Else
                    Return Nothing
                End If
            End Get
            Set(ByVal value As System.Management.ManagementScope)
                If (isEmbedded = False) Then
                    PrivateLateBoundObject.Scope = value
                End If
            End Set
        End Property

        'Property to show the commit behavior for the WMI object. If true, WMI object will be automatically saved after each property modification.(ie. Put() is called after modification of a property).
        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public Property AutoCommit() As Boolean
            Get
                Return AutoCommitProp
            End Get
            Set(ByVal value As Boolean)
                AutoCommitProp = value
            End Set
        End Property

        'The ManagementPath of the underlying WMI object.
        <Browsable(True)> _
        Public Property Path() As System.Management.ManagementPath
            Get
                If (isEmbedded = False) Then
                    Return PrivateLateBoundObject.Path
                Else
                    Return Nothing
                End If
            End Get
            Set(ByVal value As System.Management.ManagementPath)
                If (isEmbedded = False) Then
                    If (CheckIfProperClass(Nothing, value, Nothing) <> True) Then
                        Throw New System.ArgumentException("Class name does not match.")
                    End If
                    PrivateLateBoundObject.Path = value
                End If
            End Set
        End Property

        'Public static scope property which is used by the various methods.
        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public Shared Property StaticScope() As System.Management.ManagementScope
            Get
                Return statMgmtScope
            End Get
            Set(ByVal value As System.Management.ManagementScope)
                statMgmtScope = value
            End Set
        End Property


#End Region

#Region "attributes"


        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsArpAlwaysSourceRouteNull() As Boolean
            Get
                If (curObj("ArpAlwaysSourceRoute") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The ArpAlwaysSourceRoute property indicates whether the Address Resolution Protoc" & _
            "ol (ARP) must always use source routing. If this property is TRUE, TCP/IP will t" & _
            "ransmit ARP queries with source routing enabled on Token Ring networks. By defau" & _
            "lt, ARP first queries without source routing, and retries with source routing en" & _
            "abled if no reply was received. Source routing allows the routing of network pac" & _
            "kets across different types of networks. Default: FALSE."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property ArpAlwaysSourceRoute() As Boolean
            Get
                If (curObj("ArpAlwaysSourceRoute") Is Nothing) Then
                    Return System.Convert.ToBoolean(0)
                End If
                Return CType(curObj("ArpAlwaysSourceRoute"), Boolean)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsArpUseEtherSNAPNull() As Boolean
            Get
                If (curObj("ArpUseEtherSNAP") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The ArpUseEtherSNAP property indicates whether Ethernet packets follow the IEEE 8" & _
            "02.3 Sub-Network Access Protocol (SNAP) encoding. Setting this parameter to 1 wi" & _
            "ll force TCP/IP to transmit Ethernet packets using 802.3 SNAP encoding. By defau" & _
            "lt, the stack transmits packets in DIX Ethernet format. Windows NT/Windows 2000 " & _
            "systems are able to receive both formats. Default: FALSE."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property ArpUseEtherSNAP() As Boolean
            Get
                If (curObj("ArpUseEtherSNAP") Is Nothing) Then
                    Return System.Convert.ToBoolean(0)
                End If
                Return CType(curObj("ArpUseEtherSNAP"), Boolean)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("A short textual description (one-line string) of the CIM_Setting object.")> _
        Public ReadOnly Property Caption() As String
            Get
                Return CType(curObj("Caption"), String)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The DatabasePath property indicates a valid Windows file path to standard Interne" & _
            "t database files (HOSTS, LMHOSTS, NETWORKS, PROTOCOLS).  The file path is used b" & _
            "y the Windows Sockets interface. This property is only available on Windows NT/W" & _
            "indows 2000 systems.")> _
        Public ReadOnly Property DatabasePath() As String
            Get
                Return CType(curObj("DatabasePath"), String)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsDeadGWDetectEnabledNull() As Boolean
            Get
                If (curObj("DeadGWDetectEnabled") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The DeadGWDetectEnabled property indicates whether dead gateway detection occurs." & _
            " Setting this parameter to TRUE causes TCP to perform Dead Gateway Detection. Wi" & _
            "th this feature enabled, TCP will ask IP to change to a backup gateway if it ret" & _
            "ransmits a segment several times without receiving a response. Default: TRUE."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property DeadGWDetectEnabled() As Boolean
            Get
                If (curObj("DeadGWDetectEnabled") Is Nothing) Then
                    Return System.Convert.ToBoolean(0)
                End If
                Return CType(curObj("DeadGWDetectEnabled"), Boolean)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The DefaultIPGateway property contains a list of IP addresses of default gateways" & _
            " used by the computer system." & Global.Microsoft.VisualBasic.ChrW(10) & "Example: 194.161.12.1 194.162.46.1")> _
        Public ReadOnly Property DefaultIPGateway() As String()
            Get
                Return CType(curObj("DefaultIPGateway"), String())
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsDefaultTOSNull() As Boolean
            Get
                If (curObj("DefaultTOS") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The DefaultTOS property indicates the default Type Of Service (TOS) value set in " & _
            "the header of outgoing IP packets. RFC 791 defines the values. Default: 0, Valid" & _
            " Range: 0 - 255."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property DefaultTOS() As Byte
            Get
                If (curObj("DefaultTOS") Is Nothing) Then
                    Return System.Convert.ToByte(0)
                End If
                Return CType(curObj("DefaultTOS"), Byte)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsDefaultTTLNull() As Boolean
            Get
                If (curObj("DefaultTTL") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The DefaultTTL property indicates the default Time To Live (TTL) value set in the" & _
            " header of outgoing IP packets. The TTL specifies the number of routers an IP pa" & _
            "cket may pass through to reach its destination before being discarded. Each rout" & _
            "er decrements the TTL count of a packet by one as it passes through and discards" & _
            " the packets if the TTL is 0. Default: 32, Valid Range: 1 - 255."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property DefaultTTL() As Byte
            Get
                If (curObj("DefaultTTL") Is Nothing) Then
                    Return System.Convert.ToByte(0)
                End If
                Return CType(curObj("DefaultTTL"), Byte)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("A textual description of the CIM_Setting object.")> _
        Public ReadOnly Property Description() As String
            Get
                Return CType(curObj("Description"), String)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsDHCPEnabledNull() As Boolean
            Get
                If (curObj("DHCPEnabled") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The DHCPEnabled property indicates whether the dynamic host configuration protoco" & _
            "l  (DHCP) server automatically assigns an IP address to the computer system when" & _
            " establishing a network connection." & Global.Microsoft.VisualBasic.ChrW(10) & "Values: TRUE or FALSE. If TRUE, DHCP is enab" & _
            "led."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property DHCPEnabled() As Boolean
            Get
                If (curObj("DHCPEnabled") Is Nothing) Then
                    Return System.Convert.ToBoolean(0)
                End If
                Return CType(curObj("DHCPEnabled"), Boolean)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsDHCPLeaseExpiresNull() As Boolean
            Get
                If (curObj("DHCPLeaseExpires") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The DHCPLeaseExpires property indicates the expiration date and time for a leased" & _
            " IP address that was assigned to the computer by the dynamic host configuration " & _
            "protocol (DHCP) server." & Global.Microsoft.VisualBasic.ChrW(10) & "Example: 20521201000230.000000000"), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property DHCPLeaseExpires() As Date
            Get
                If (Not (curObj("DHCPLeaseExpires")) Is Nothing) Then
                    Return ToDateTime(CType(curObj("DHCPLeaseExpires"), String))
                Else
                    Return Date.MinValue
                End If
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsDHCPLeaseObtainedNull() As Boolean
            Get
                If (curObj("DHCPLeaseObtained") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The DHCPLeaseObtained property indicates the date and time the lease was obtained" & _
            " for the IP address assigned to the computer by the dynamic host configuration p" & _
            "rotocol (DHCP) server. " & Global.Microsoft.VisualBasic.ChrW(10) & "Example: 19521201000230.000000000"), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property DHCPLeaseObtained() As Date
            Get
                If (Not (curObj("DHCPLeaseObtained")) Is Nothing) Then
                    Return ToDateTime(CType(curObj("DHCPLeaseObtained"), String))
                Else
                    Return Date.MinValue
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The DHCPServer property indicates the IP address of the dynamic host configuratio" & _
            "n protocol (DHCP) server." & Global.Microsoft.VisualBasic.ChrW(10) & "Example: 154.55.34")> _
        Public ReadOnly Property DHCPServer() As String
            Get
                Return CType(curObj("DHCPServer"), String)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The DNSDomain property indicates an organization name followed by a period and an" & _
            " extension that indicates the type of organization, such as microsoft.com. The n" & _
            "ame can be any combination of the letters A through Z, the numerals 0 through 9," & _
            " and the hyphen (-), plus the period (.) character used as a separator." & Global.Microsoft.VisualBasic.ChrW(10) & "Example:" & _
            " microsoft.com")> _
        Public ReadOnly Property DNSDomain() As String
            Get
                Return CType(curObj("DNSDomain"), String)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The DNSDomainSuffixSearchOrder property specifies the DNS domain suffixes to be a" & _
            "ppended to the end of host names during name resolution. When attempting to reso" & _
            "lve a fully qualified domain name (FQDN) from a host only name, the system will " & _
            "first append the local domain name. If this is not successful, the system will u" & _
            "se the domain suffix list to create additional FQDNs in the order listed and que" & _
            "ry DNS servers for each." & Global.Microsoft.VisualBasic.ChrW(10) & "Example: samples.microsoft.com example.microsoft.com")> _
        Public ReadOnly Property DNSDomainSuffixSearchOrder() As String()
            Get
                Return CType(curObj("DNSDomainSuffixSearchOrder"), String())
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsDNSEnabledForWINSResolutionNull() As Boolean
            Get
                If (curObj("DNSEnabledForWINSResolution") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The DNSEnabledForWINSResolution property indicates whether the Domain Name System" & _
            " (DNS) is enabled for name resolution over Windows Internet Naming Service (WINS" & _
            ") resolution. If the name cannot be resolved using DNS, the name request is forw" & _
            "arded to WINS for resolution."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property DNSEnabledForWINSResolution() As Boolean
            Get
                If (curObj("DNSEnabledForWINSResolution") Is Nothing) Then
                    Return System.Convert.ToBoolean(0)
                End If
                Return CType(curObj("DNSEnabledForWINSResolution"), Boolean)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The DNSHostName property indicates the host name used to identify the local compu" & _
            "ter for authentication by some utilities. Other TCP/IP-based utilities can use t" & _
            "his value to acquire the name of the local computer. Host names are stored on DN" & _
            "S servers in a table that maps names to IP addresses for use by DNS. The name ca" & _
            "n be any combination of the letters A through Z, the numerals 0 through 9, and t" & _
            "he hyphen (-), plus the period (.) character used as a separator. By default, th" & _
            "is value is the Microsoft networking computer name, but the network administrato" & _
            "r can assign another host name without affecting the computer name." & Global.Microsoft.VisualBasic.ChrW(10) & "Example: cor" & _
            "pdns")> _
        Public ReadOnly Property DNSHostName() As String
            Get
                Return CType(curObj("DNSHostName"), String)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The DNSServerSearchOrder property indicates an ordered list of server IP addresse" & _
            "s to be used in querying for DNS Servers.")> _
        Public ReadOnly Property DNSServerSearchOrder() As String()
            Get
                Return CType(curObj("DNSServerSearchOrder"), String())
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsDomainDNSRegistrationEnabledNull() As Boolean
            Get
                If (curObj("DomainDNSRegistrationEnabled") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The DomainDNSRegistrationEnabled property specifies whether the IP addresses for " & _
            "this connection are registered in DNS under the domain name of this connection, " & _
            "in addition to registering under the computer's full DNS name. The domain name o" & _
            "f this connection is either set via the method SetDNSDomain() or assigned by DHC" & _
            "P. The registered name is the host name of the computer with the domain name app" & _
            "ended. Windows 2000 only."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property DomainDNSRegistrationEnabled() As Boolean
            Get
                If (curObj("DomainDNSRegistrationEnabled") Is Nothing) Then
                    Return System.Convert.ToBoolean(0)
                End If
                Return CType(curObj("DomainDNSRegistrationEnabled"), Boolean)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsForwardBufferMemoryNull() As Boolean
            Get
                If (curObj("ForwardBufferMemory") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The ForwardBufferMemory property indicates how much memory IP allocates to store " & _
            "packet data in the router packet queue. When this buffer space is filled, the ro" & _
            "uter begins discarding packets at random from its queue. Packet queue data buffe" & _
            "rs are 256 bytes in length, so the value of this parameter should be a multiple " & _
            "of 256. Multiple buffers are chained together for larger packets. The IP header " & _
            "for a packet is stored separately. This parameter is ignored and no buffers are " & _
            "allocated if the IP router is not enabled. The buffer size can range from the ne" & _
            "twork MTU to the a value smaller than 0xFFFFFFFF. Default: 74240 (fifty 1480-byt" & _
            "e packets, rounded to a multiple of 256)."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property ForwardBufferMemory() As UInteger
            Get
                If (curObj("ForwardBufferMemory") Is Nothing) Then
                    Return System.Convert.ToUInt32(0)
                End If
                Return CType(curObj("ForwardBufferMemory"), UInteger)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsFullDNSRegistrationEnabledNull() As Boolean
            Get
                If (curObj("FullDNSRegistrationEnabled") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The FullDNSRegistrationEnabled property specifies whether the IP addresses for th" & _
            "is connection are registered in DNS under the computer's full DNS name. The full" & _
            " DNS name of the computer is displayed on the Network Identification tab of the " & _
            "System Control Panel. Windows 2000 only."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property FullDNSRegistrationEnabled() As Boolean
            Get
                If (curObj("FullDNSRegistrationEnabled") Is Nothing) Then
                    Return System.Convert.ToBoolean(0)
                End If
                Return CType(curObj("FullDNSRegistrationEnabled"), Boolean)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The GatewayCostMetric reflects an integer cost metric (ranging from 1 to 9999) to" & _
            " be used in calculating the fastest, most reliable, and/or least expensive route" & _
            "s. This argument has a one to one correspondence with the DefaultIPGateway. Wind" & _
            "ows 2000 only.")> _
        Public ReadOnly Property GatewayCostMetric() As UShort()
            Get
                Return CType(curObj("GatewayCostMetric"), UShort())
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsIGMPLevelNull() As Boolean
            Get
                If (curObj("IGMPLevel") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The IGMPLevel property indicates the extent to which the system supports IP multi" & _
            "cast and participates in the Internet Group Management Protocol. At level 0, the" & _
            " system provides no multicast support. At level 1, the system may only send IP m" & _
            "ulticast packets. At level 2, the system may send IP multicast packets and fully" & _
            " participate in IGMP to receive multicast packets. Default: 2"), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property IGMPLevel() As IGMPLevelValues
            Get
                If (curObj("IGMPLevel") Is Nothing) Then
                    Return CType(System.Convert.ToInt32(3), IGMPLevelValues)
                End If
                Return CType(System.Convert.ToInt32(curObj("IGMPLevel")), IGMPLevelValues)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsIndexNull() As Boolean
            Get
                If (curObj("Index") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The Index property specifies the index number of the Win32 network adapter config" & _
            "uration. The index number is used when there is more than one configuration avai" & _
            "lable."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property Index() As UInteger
            Get
                If (curObj("Index") Is Nothing) Then
                    Return System.Convert.ToUInt32(0)
                End If
                Return CType(curObj("Index"), UInteger)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsInterfaceIndexNull() As Boolean
            Get
                If (curObj("InterfaceIndex") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The InterfaceIndex property contains the index value that uniquely identifies the" & _
            " local interface."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property InterfaceIndex() As UInteger
            Get
                If (curObj("InterfaceIndex") Is Nothing) Then
                    Return System.Convert.ToUInt32(0)
                End If
                Return CType(curObj("InterfaceIndex"), UInteger)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The IPAddress property contains a list of all of the IP addresses associated with" & _
            " the current network adapter." & Global.Microsoft.VisualBasic.ChrW(10) & "Example: 155.34.22.0")> _
        Public ReadOnly Property IPAddress() As String()
            Get
                Return CType(curObj("IPAddress"), String())
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsIPConnectionMetricNull() As Boolean
            Get
                If (curObj("IPConnectionMetric") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The IPConnectionMetric indicates the cost of using the configured routes for this" & _
            " IP bound adapter and is the weighted value for those routes in the IP routing t" & _
            "able. If there are multiple routes to a destination in the IP routing table, the" & _
            " route with the lowest metric is used. The default value is 1.Windows 2000 only." & _
            ""), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property IPConnectionMetric() As UInteger
            Get
                If (curObj("IPConnectionMetric") Is Nothing) Then
                    Return System.Convert.ToUInt32(0)
                End If
                Return CType(curObj("IPConnectionMetric"), UInteger)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsIPEnabledNull() As Boolean
            Get
                If (curObj("IPEnabled") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The IPEnabled property indicates whether TCP/IP is bound and enabled on this netw" & _
            "ork adapt."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property IPEnabled() As Boolean
            Get
                If (curObj("IPEnabled") Is Nothing) Then
                    Return System.Convert.ToBoolean(0)
                End If
                Return CType(curObj("IPEnabled"), Boolean)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsIPFilterSecurityEnabledNull() As Boolean
            Get
                If (curObj("IPFilterSecurityEnabled") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The IPFilterSecurityEnabled property indicates whether IP port security is enable" & _
            "d globally across all IP-bound network adapters. This property is used in conjun" & _
            "ction with IPSecPermitTCPPorts, IPSecPermitUDPPorts, and IPSecPermitIPProtocols." & _
            " A value of TRUE indicates that IP port security is enabled and that the securit" & _
            "y values associated with individual network adapters are in effect. A value of F" & _
            "ALSE indicates IP filter security is disabled across all network adapters and al" & _
            "lows all port and protocol traffic to flow unfiltered."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property IPFilterSecurityEnabled() As Boolean
            Get
                If (curObj("IPFilterSecurityEnabled") Is Nothing) Then
                    Return System.Convert.ToBoolean(0)
                End If
                Return CType(curObj("IPFilterSecurityEnabled"), Boolean)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsIPPortSecurityEnabledNull() As Boolean
            Get
                If (curObj("IPPortSecurityEnabled") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The IPPortSecurityEnabled property indicates whether IP port security is enabled " & _
            "globally across all IP-bound network adapters. This property has been deprecated" & _
            " in favor of IPFilterSecurityEnabled."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property IPPortSecurityEnabled() As Boolean
            Get
                If (curObj("IPPortSecurityEnabled") Is Nothing) Then
                    Return System.Convert.ToBoolean(0)
                End If
                Return CType(curObj("IPPortSecurityEnabled"), Boolean)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The IPSecPermitIPProtocols property lists the protocols permitted to run over the" & _
            " IP. The list of protocols is defined using the EnableIPSec method. The list wil" & _
            "l either be empty or contain numeric values. A numeric value of zero indicates a" & _
            "ccess permission is granted for all protocols. An empty string indicates that no" & _
            " protocols are permitted to run when IPFilterSecurityEnabled is TRUE.")> _
        Public ReadOnly Property IPSecPermitIPProtocols() As String()
            Get
                Return CType(curObj("IPSecPermitIPProtocols"), String())
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The IPSecPermitTCPPorts property lists the ports that will be granted access perm" & _
            "ission for TCP. The list of protocols is defined using the EnableIPSec method. T" & _
            "he list will either be empty or contain numeric values. A numeric value of zero " & _
            "indicates access permission is granted for all ports. An empty string indicates " & _
            "that no ports are granted access permission when IPFilterSecurityEnabled is TRUE" & _
            ".")> _
        Public ReadOnly Property IPSecPermitTCPPorts() As String()
            Get
                Return CType(curObj("IPSecPermitTCPPorts"), String())
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The IPSecPermitUDPPorts property lists the ports that will be granted User Datagr" & _
            "am Protocol (UDP) access permission. The list of protocols is defined using the " & _
            "EnableIPSec method. The list will either be empty or contain numeric values. A n" & _
            "umeric value of zero indicates access permission is granted for all ports. An em" & _
            "pty string indicates that no ports are granted access permission when IPFilterSe" & _
            "curityEnabled is TRUE.")> _
        Public ReadOnly Property IPSecPermitUDPPorts() As String()
            Get
                Return CType(curObj("IPSecPermitUDPPorts"), String())
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The IPSubnet property contains a list of all the subnet masks associated with the" & _
            " current network adapter." & Global.Microsoft.VisualBasic.ChrW(10) & "Example: 255.255.0")> _
        Public ReadOnly Property IPSubnet() As String()
            Get
                Return CType(curObj("IPSubnet"), String())
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsIPUseZeroBroadcastNull() As Boolean
            Get
                If (curObj("IPUseZeroBroadcast") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The IPUseZeroBroadcast property indicates whether IP zeros-broadcasts are used. I" & _
            "f this parameter is set TRUE, then IP uses zeros-broadcasts (0.0.0.0), and the s" & _
            "ystem uses ones-broadcasts (255.255.255.255). Computer systems generally use one" & _
            "s-broadcasts, but those derived from BSD implementations use zeros-broadcasts. S" & _
            "ystems that do not use that same broadcasts will not interoperate on the same ne" & _
            "twork. Default: FALSE."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property IPUseZeroBroadcast() As Boolean
            Get
                If (curObj("IPUseZeroBroadcast") Is Nothing) Then
                    Return System.Convert.ToBoolean(0)
                End If
                Return CType(curObj("IPUseZeroBroadcast"), Boolean)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The IPXAddress property indicates the Internetworking Packet Exchange (IPX) addre" & _
            "ss of the network adapter. The IPX address identifies a computer system on a net" & _
            "work using the IPX protocol.")> _
        Public ReadOnly Property IPXAddress() As String
            Get
                Return CType(curObj("IPXAddress"), String)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsIPXEnabledNull() As Boolean
            Get
                If (curObj("IPXEnabled") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The IPXEnabled property determines whether the or Internetwork Packet Exchange (I" & _
            "PX) protocol is bound and enabled for this adapter."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property IPXEnabled() As Boolean
            Get
                If (curObj("IPXEnabled") Is Nothing) Then
                    Return System.Convert.ToBoolean(0)
                End If
                Return CType(curObj("IPXEnabled"), Boolean)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The IPXFrameType property represents an integer array of frame type identifiers. " & _
            "The values in this array correspond to the elements in the IPXNetworkNumber.")> _
        Public ReadOnly Property IPXFrameType() As IPXFrameTypeValues()
            Get
                Dim arrEnumVals As System.Array = CType(curObj("IPXFrameType"), System.Array)
                Dim enumToRet((arrEnumVals.Length) - 1) As IPXFrameTypeValues
                Dim counter As Integer = 0
                counter = 0
                Do While (counter < arrEnumVals.Length)
                    enumToRet(counter) = CType(System.Convert.ToInt32(arrEnumVals.GetValue(counter)), IPXFrameTypeValues)
                    counter = (counter + 1)
                Loop
                Return enumToRet
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsIPXMediaTypeNull() As Boolean
            Get
                If (curObj("IPXMediaType") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The IPXMediaType property represents an Internetworking Packet Exchange (IPX) med" & _
            "ia type identifier."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property IPXMediaType() As IPXMediaTypeValues
            Get
                If (curObj("IPXMediaType") Is Nothing) Then
                    Return CType(System.Convert.ToInt32(0), IPXMediaTypeValues)
                End If
                Return CType(System.Convert.ToInt32(curObj("IPXMediaType")), IPXMediaTypeValues)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The IPXNetworkNumber property represents an array of characters that uniquely ide" & _
            "ntifies a frame/network adapter combination on the computer system. The NetWare " & _
            "Link (NWLink) IPX/SPX-compatible transport in Windows 2000 and Windows NT 4.0 an" & _
            "d greater uses two distinctly different types of network numbers. This number is" & _
            " sometimes referred to as the external network number. It must be unique for eac" & _
            "h network segment. The order in this string list will correspond item-for-item w" & _
            "ith the elements in the IPXFrameType property.")> _
        Public ReadOnly Property IPXNetworkNumber() As String()
            Get
                Return CType(curObj("IPXNetworkNumber"), String())
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The IPXVirtualNetNumber property uniquely identifies the computer system on the n" & _
            "etwork. It is represented in the form of an eight-character hexadecimal digit. W" & _
            "indows NT/2000 uses the virtual network number (also known as an internal networ" & _
            "k number) for internal routing.")> _
        Public ReadOnly Property IPXVirtualNetNumber() As String
            Get
                Return CType(curObj("IPXVirtualNetNumber"), String)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsKeepAliveIntervalNull() As Boolean
            Get
                If (curObj("KeepAliveInterval") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The KeepAliveInterval property indicates the interval separating Keep Alive Retra" & _
            "nsmissions until a response is received. Once a response is received, the delay " & _
            "until the next Keep Alive Transmission is again controlled by the value of KeepA" & _
            "liveTime. The connection will be aborted after the number of retransmissions spe" & _
            "cified by TcpMaxDataRetransmissions have gone unanswered. Default: 1000, Valid R" & _
            "ange: 1 - 0xFFFFFFFF."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property KeepAliveInterval() As UInteger
            Get
                If (curObj("KeepAliveInterval") Is Nothing) Then
                    Return System.Convert.ToUInt32(0)
                End If
                Return CType(curObj("KeepAliveInterval"), UInteger)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsKeepAliveTimeNull() As Boolean
            Get
                If (curObj("KeepAliveTime") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The KeepAliveTime property indicates how often the TCP attempts to verify that an" & _
            " idle connection is still intact by sending a Keep Alive Packet. A remote system" & _
            " that is reachable will acknowledge the keep alive transmission. Keep Alive pack" & _
            "ets are not sent by default. This feature may be enabled in a connection by an a" & _
            "pplication. Default: 7,200,000 (two hours)"), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property KeepAliveTime() As UInteger
            Get
                If (curObj("KeepAliveTime") Is Nothing) Then
                    Return System.Convert.ToUInt32(0)
                End If
                Return CType(curObj("KeepAliveTime"), UInteger)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The MACAddress property indicates the Media Access Control (MAC) address of the n" & _
            "etwork adapter. A MAC address is assigned by the manufacturer to uniquely identi" & _
            "fy the network adapter." & Global.Microsoft.VisualBasic.ChrW(10) & "Example: 00:80:C7:8F:6C:96")> _
        Public ReadOnly Property MACAddress() As String
            Get
                Return CType(curObj("MACAddress"), String)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsMTUNull() As Boolean
            Get
                If (curObj("MTU") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The MTU property overrides the default Maximum Transmission Unit (MTU) for a netw" & _
            "ork interface. The MTU is the maximum packet size (including the transport heade" & _
            "r) that the transport will transmit over the underlying network. The IP datagram" & _
            " can span multiple packets. The range of this value spans the minimum packet siz" & _
            "e (68) to the MTU supported by the underlying network."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property MTU() As UInteger
            Get
                If (curObj("MTU") Is Nothing) Then
                    Return System.Convert.ToUInt32(0)
                End If
                Return CType(curObj("MTU"), UInteger)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsNumForwardPacketsNull() As Boolean
            Get
                If (curObj("NumForwardPackets") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The NumForwardPackets property indicates the number of IP packet headers allocate" & _
            "d for the router packet queue. When all headers are in use, the router will begi" & _
            "n to discard packets from the queue at random. This value should be at least as " & _
            "large as the ForwardBufferMemory value divided by the maximum IP data size of th" & _
            "e networks connected to the router. It should be no larger than the ForwardBuffe" & _
            "rMemory value divided by 256, since at least 256 bytes of forward buffer memory " & _
            "are used for each packet. The optimal number of forward packets for a given Forw" & _
            "ardBufferMemory size depends on the type of traffic carried on the network. It w" & _
            "ill lie somewhere between these two values. If the router is not enabled, this p" & _
            "arameter is ignored and no headers are allocated. Default: 50, Valid Range: 1 - " & _
            "0xFFFFFFFE."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property NumForwardPackets() As UInteger
            Get
                If (curObj("NumForwardPackets") Is Nothing) Then
                    Return System.Convert.ToUInt32(0)
                End If
                Return CType(curObj("NumForwardPackets"), UInteger)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsPMTUBHDetectEnabledNull() As Boolean
            Get
                If (curObj("PMTUBHDetectEnabled") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The PMTUBHDetectEnabled property indicates whether detection of black hole router" & _
            "s occurs. Setting this parameter to TRUE causes TCP to try to detect black hole " & _
            "routers while discovering the path of the Maximum Transmission Unit. A black hol" & _
            "e router does not return ICMP Destination Unreachable messages when it needs to " & _
            "fragment an IP datagram with the Don't Fragment bit set. TCP depends on receivin" & _
            "g these messages to perform Path MTU Discovery. With this feature enabled, TCP w" & _
            "ill try to send segments without the Don't Fragment bit set if several retransmi" & _
            "ssions of a segment go unacknowledged. If the segment is acknowledged as a resul" & _
            "t, the MSS will be decreased and the Don't Fragment bit will be set in future pa" & _
            "ckets on the connection. Enabling black hole detection increases the maximum num" & _
            "ber of retransmissions performed for a given segment. The default value of this " & _
            "property is FALSE."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property PMTUBHDetectEnabled() As Boolean
            Get
                If (curObj("PMTUBHDetectEnabled") Is Nothing) Then
                    Return System.Convert.ToBoolean(0)
                End If
                Return CType(curObj("PMTUBHDetectEnabled"), Boolean)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsPMTUDiscoveryEnabledNull() As Boolean
            Get
                If (curObj("PMTUDiscoveryEnabled") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The PMTUDiscoveryEnabled property indicates whether the Maximum Transmission Unit" & _
            " (MTU) path is discovered. Setting this parameter to TRUE causes TCP to attempt " & _
            "to discover the MTU (the largest packet size) over the path to a remote host. By" & _
            " discovering the MTU path and limiting TCP segments to this size, TCP can elimin" & _
            "ate fragmentation at routers along the path that connect networks with different" & _
            " MTUs. Fragmentation adversely affects TCP throughput and network congestion. Se" & _
            "tting this parameter to FALSE causes an MTU of 576 bytes to be used for all conn" & _
            "ections that are not to machines on the local subnet. Default: TRUE."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property PMTUDiscoveryEnabled() As Boolean
            Get
                If (curObj("PMTUDiscoveryEnabled") Is Nothing) Then
                    Return System.Convert.ToBoolean(0)
                End If
                Return CType(curObj("PMTUDiscoveryEnabled"), Boolean)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The ServiceName property indicates the service name of the network adapter. This " & _
            "name is usually shorter than the full product name. " & Global.Microsoft.VisualBasic.ChrW(10) & "Example: Elnkii.")> _
        Public ReadOnly Property ServiceName() As String
            Get
                Return CType(curObj("ServiceName"), String)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The identifier by which the CIM_Setting object is known.")> _
        Public ReadOnly Property SettingID() As String
            Get
                Return CType(curObj("SettingID"), String)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsTcpipNetbiosOptionsNull() As Boolean
            Get
                If (curObj("TcpipNetbiosOptions") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The TcpipNetbiosOptions property specifies a bitmap of the possible settings rela" & _
            "ted to NetBIOS over TCP/IP. Windows 2000 only."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property TcpipNetbiosOptions() As TcpipNetbiosOptionsValues
            Get
                If (curObj("TcpipNetbiosOptions") Is Nothing) Then
                    Return CType(System.Convert.ToInt32(3), TcpipNetbiosOptionsValues)
                End If
                Return CType(System.Convert.ToInt32(curObj("TcpipNetbiosOptions")), TcpipNetbiosOptionsValues)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsTcpMaxConnectRetransmissionsNull() As Boolean
            Get
                If (curObj("TcpMaxConnectRetransmissions") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The TcpMaxConnectRetransmissions property indicates the number of times TCP will " & _
            "attempt to retransmit a Connect Request before terminating the connection. The i" & _
            "nitial retransmission timeout is 3 seconds. The retransmission timeout doubles f" & _
            "or each attempt. Default: 3, Valid Range: 0 - 0xFFFFFFFF."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property TcpMaxConnectRetransmissions() As UInteger
            Get
                If (curObj("TcpMaxConnectRetransmissions") Is Nothing) Then
                    Return System.Convert.ToUInt32(0)
                End If
                Return CType(curObj("TcpMaxConnectRetransmissions"), UInteger)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsTcpMaxDataRetransmissionsNull() As Boolean
            Get
                If (curObj("TcpMaxDataRetransmissions") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The TcpMaxDataRetransmissions property indicates the number of times TCP will ret" & _
            "ransmit an individual data segment (non-connect segment) before terminating the " & _
            "connection. The retransmission timeout doubles with each successive retransmissi" & _
            "on on a connection. Default: 5, Valid Range: 0 - 0xFFFFFFFF."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property TcpMaxDataRetransmissions() As UInteger
            Get
                If (curObj("TcpMaxDataRetransmissions") Is Nothing) Then
                    Return System.Convert.ToUInt32(0)
                End If
                Return CType(curObj("TcpMaxDataRetransmissions"), UInteger)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsTcpNumConnectionsNull() As Boolean
            Get
                If (curObj("TcpNumConnections") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The TcpNumConnections property indicates the maximum number of connections that T" & _
            "CP can have open simultaneously. Default: 0xFFFFFE, Valid Range: 0 - 0xFFFFFE."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property TcpNumConnections() As UInteger
            Get
                If (curObj("TcpNumConnections") Is Nothing) Then
                    Return System.Convert.ToUInt32(0)
                End If
                Return CType(curObj("TcpNumConnections"), UInteger)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsTcpUseRFC1122UrgentPointerNull() As Boolean
            Get
                If (curObj("TcpUseRFC1122UrgentPointer") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The TcpUseRFC1122UrgentPointer property indicates whether TCP uses the RFC 1122 s" & _
            "pecification or the mode used by Berkeley Software Design (BSD) derived systems," & _
            " for urgent data. The two mechanisms interpret the urgent pointer differently an" & _
            "d are not interoperable. Windows 2000 and Windows NT version 3.51 and higher def" & _
            "aults to BSD mode. If TRUE, urgent data is sent in RFC 1122 mode. Default: FALSE" & _
            "."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property TcpUseRFC1122UrgentPointer() As Boolean
            Get
                If (curObj("TcpUseRFC1122UrgentPointer") Is Nothing) Then
                    Return System.Convert.ToBoolean(0)
                End If
                Return CType(curObj("TcpUseRFC1122UrgentPointer"), Boolean)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsTcpWindowSizeNull() As Boolean
            Get
                If (curObj("TcpWindowSize") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The TcpWindowSize property contains the maximum TCP Receive  Window size offered " & _
            "by the system. The Receive Window specifies the number of bytes a sender may tra" & _
            "nsmit without receiving an acknowledgment. In general, larger receiving windows " & _
            "will improve performance over high delay and high bandwidth networks. For effici" & _
            "ency, the receiving window should be an even multiple of the TCP Maximum Segment" & _
            " Size (MSS). Default: Four times the maximum TCP data size or an even multiple o" & _
            "f TCP data size rounded up to the nearest multiple of 8192. Ethernet networks de" & _
            "fault to 8760. Valid Range: 0 - 65535."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property TcpWindowSize() As UShort
            Get
                If (curObj("TcpWindowSize") Is Nothing) Then
                    Return System.Convert.ToUInt16(0)
                End If
                Return CType(curObj("TcpWindowSize"), UShort)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsWINSEnableLMHostsLookupNull() As Boolean
            Get
                If (curObj("WINSEnableLMHostsLookup") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The WINSEnableLMHostsLookup property indicates whether local lookup files are use" & _
            "d. Lookup files will contain a map of IP addresses to host names. If they exist " & _
            "on the local system, they will be found in %SystemRoot%\system32\drivers\etc."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property WINSEnableLMHostsLookup() As Boolean
            Get
                If (curObj("WINSEnableLMHostsLookup") Is Nothing) Then
                    Return System.Convert.ToBoolean(0)
                End If
                Return CType(curObj("WINSEnableLMHostsLookup"), Boolean)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The WINSHostLookupFile property contains a path to a WINS lookup file on the loca" & _
            "l system. This file will contain a map of IP addresses to host names. If the fil" & _
            "e specified in this property is found, it will be copied to the %SystemRoot%\sys" & _
            "tem32\drivers\etc folder of the local system. Valid only if the WINSEnableLMHost" & _
            "sLookup property is TRUE.")> _
        Public ReadOnly Property WINSHostLookupFile() As String
            Get
                Return CType(curObj("WINSHostLookupFile"), String)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The WINSPrimaryServer property indicates the IP address for the primary WINS serv" & _
            "er. ")> _
        Public ReadOnly Property WINSPrimaryServer() As String
            Get
                Return CType(curObj("WINSPrimaryServer"), String)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The WINSScopeID property provides a way to isolate a group of computer systems th" & _
            "at communicate with each other only. The Scope ID is a character string value th" & _
            "at is appended to the end of the NetBIOS name. It is used for all NetBIOS transa" & _
            "ctions  over TCP/IP communications from that computer system. Computers configur" & _
            "ed with identical Scope IDs are able to communicate with this computer. TCP/IP c" & _
            "lients with different Scope IDs disregard packets from computers with this Scope" & _
            " ID. Valid only when the EnableWINS method executes successfully.")> _
        Public ReadOnly Property WINSScopeID() As String
            Get
                Return CType(curObj("WINSScopeID"), String)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The WINSSecondaryServer property indicates the IP address for the secondary WINS " & _
            "server. ")> _
        Public ReadOnly Property WINSSecondaryServer() As String
            Get
                Return CType(curObj("WINSSecondaryServer"), String)
            End Get
        End Property


#End Region


#Region "the rest of it"



        Private Overloads Function CheckIfProperClass(ByVal mgmtScope As System.Management.ManagementScope, ByVal path As System.Management.ManagementPath, ByVal OptionsParam As System.Management.ObjectGetOptions) As Boolean
            If ((Not (path) Is Nothing) _
                        AndAlso (String.Compare(path.ClassName, Me.ManagementClassName, True, System.Globalization.CultureInfo.InvariantCulture) = 0)) Then
                Return True
            Else
                Return CheckIfProperClass(New System.Management.ManagementObject(mgmtScope, path, OptionsParam))
            End If
        End Function

        Private Overloads Function CheckIfProperClass(ByVal theObj As System.Management.ManagementBaseObject) As Boolean
            If ((Not (theObj) Is Nothing) _
                        AndAlso (String.Compare(CType(theObj("__CLASS"), String), Me.ManagementClassName, True, System.Globalization.CultureInfo.InvariantCulture) = 0)) Then
                Return True
            Else
                Dim parentClasses As System.Array = CType(theObj("__DERIVATION"), System.Array)
                If (Not (parentClasses) Is Nothing) Then
                    Dim count As Integer = 0
                    count = 0
                    Do While (count < parentClasses.Length)
                        If (String.Compare(CType(parentClasses.GetValue(count), String), Me.ManagementClassName, True, System.Globalization.CultureInfo.InvariantCulture) = 0) Then
                            Return True
                        End If
                        count = (count + 1)
                    Loop
                End If
            End If
            Return False
        End Function

        Private Function ShouldSerializeArpAlwaysSourceRoute() As Boolean
            If (Me.IsArpAlwaysSourceRouteNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeArpUseEtherSNAP() As Boolean
            If (Me.IsArpUseEtherSNAPNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeDeadGWDetectEnabled() As Boolean
            If (Me.IsDeadGWDetectEnabledNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeDefaultTOS() As Boolean
            If (Me.IsDefaultTOSNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeDefaultTTL() As Boolean
            If (Me.IsDefaultTTLNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeDHCPEnabled() As Boolean
            If (Me.IsDHCPEnabledNull = False) Then
                Return True
            End If
            Return False
        End Function

        'Converts a given datetime in DMTF format to System.DateTime object.
        Shared Function ToDateTime(ByVal dmtfDate As String) As Date
            Dim initializer As Date = Date.MinValue
            Dim year As Integer = initializer.Year
            Dim month As Integer = initializer.Month
            Dim day As Integer = initializer.Day
            Dim hour As Integer = initializer.Hour
            Dim minute As Integer = initializer.Minute
            Dim second As Integer = initializer.Second
            Dim ticks As Long = 0
            Dim dmtf As String = dmtfDate
            Dim datetime As Date = Date.MinValue
            Dim tempString As String = String.Empty
            If (dmtf Is Nothing) Then
                Throw New System.ArgumentOutOfRangeException
            End If
            If (dmtf.Length = 0) Then
                Throw New System.ArgumentOutOfRangeException
            End If
            If (dmtf.Length <> 25) Then
                Throw New System.ArgumentOutOfRangeException
            End If
            Try
                tempString = dmtf.Substring(0, 4)
                If ("****" <> tempString) Then
                    year = Integer.Parse(tempString)
                End If
                tempString = dmtf.Substring(4, 2)
                If ("**" <> tempString) Then
                    month = Integer.Parse(tempString)
                End If
                tempString = dmtf.Substring(6, 2)
                If ("**" <> tempString) Then
                    day = Integer.Parse(tempString)
                End If
                tempString = dmtf.Substring(8, 2)
                If ("**" <> tempString) Then
                    hour = Integer.Parse(tempString)
                End If
                tempString = dmtf.Substring(10, 2)
                If ("**" <> tempString) Then
                    minute = Integer.Parse(tempString)
                End If
                tempString = dmtf.Substring(12, 2)
                If ("**" <> tempString) Then
                    second = Integer.Parse(tempString)
                End If
                tempString = dmtf.Substring(15, 6)
                If ("******" <> tempString) Then
                    ticks = (Long.Parse(tempString) * CType((System.TimeSpan.TicksPerMillisecond / 1000), Long))
                End If
                If ((((((((year < 0) _
                            OrElse (month < 0)) _
                            OrElse (day < 0)) _
                            OrElse (hour < 0)) _
                            OrElse (minute < 0)) _
                            OrElse (minute < 0)) _
                            OrElse (second < 0)) _
                            OrElse (ticks < 0)) Then
                    Throw New System.ArgumentOutOfRangeException
                End If
            Catch e As System.Exception
                Throw New System.ArgumentOutOfRangeException(Nothing, e.Message)
            End Try
            datetime = New Date(year, month, day, hour, minute, second, 0)
            datetime = datetime.AddTicks(ticks)
            Dim tickOffset As System.TimeSpan = System.TimeZone.CurrentTimeZone.GetUtcOffset(datetime)
            Dim UTCOffset As Integer = 0
            Dim OffsetToBeAdjusted As Integer = 0
            Dim OffsetMins As Long = CType((tickOffset.Ticks / System.TimeSpan.TicksPerMinute), Long)
            tempString = dmtf.Substring(22, 3)
            If (tempString <> "******") Then
                tempString = dmtf.Substring(21, 4)
                Try
                    UTCOffset = Integer.Parse(tempString)
                Catch e As System.Exception
                    Throw New System.ArgumentOutOfRangeException(Nothing, e.Message)
                End Try
                OffsetToBeAdjusted = CType((OffsetMins - UTCOffset), Integer)
                datetime = datetime.AddMinutes(CType(OffsetToBeAdjusted, Double))
            End If
            Return datetime
        End Function

        'Converts a given System.DateTime object to DMTF datetime format.
        Shared Function ToDmtfDateTime(ByVal [date] As Date) As String
            Dim utcString As String = String.Empty
            Dim tickOffset As System.TimeSpan = System.TimeZone.CurrentTimeZone.GetUtcOffset([date])
            Dim OffsetMins As Long = CType((tickOffset.Ticks / System.TimeSpan.TicksPerMinute), Long)
            If (System.Math.Abs(OffsetMins) > 999) Then
                [date] = [date].ToUniversalTime
                utcString = "+000"
            Else
                If (tickOffset.Ticks >= 0) Then
                    utcString = String.Concat("+", CType((tickOffset.Ticks / System.TimeSpan.TicksPerMinute), System.Int64).ToString.PadLeft(3, Global.Microsoft.VisualBasic.ChrW(48)))
                Else
                    Dim strTemp As String = CType(OffsetMins, System.Int64).ToString
                    utcString = String.Concat("-", strTemp.Substring(1, (strTemp.Length - 1)).PadLeft(3, Global.Microsoft.VisualBasic.ChrW(48)))
                End If
            End If
            Dim dmtfDateTime As String = CType([date].Year, System.Int32).ToString.PadLeft(4, Global.Microsoft.VisualBasic.ChrW(48))
            dmtfDateTime = String.Concat(dmtfDateTime, CType([date].Month, System.Int32).ToString.PadLeft(2, Global.Microsoft.VisualBasic.ChrW(48)))
            dmtfDateTime = String.Concat(dmtfDateTime, CType([date].Day, System.Int32).ToString.PadLeft(2, Global.Microsoft.VisualBasic.ChrW(48)))
            dmtfDateTime = String.Concat(dmtfDateTime, CType([date].Hour, System.Int32).ToString.PadLeft(2, Global.Microsoft.VisualBasic.ChrW(48)))
            dmtfDateTime = String.Concat(dmtfDateTime, CType([date].Minute, System.Int32).ToString.PadLeft(2, Global.Microsoft.VisualBasic.ChrW(48)))
            dmtfDateTime = String.Concat(dmtfDateTime, CType([date].Second, System.Int32).ToString.PadLeft(2, Global.Microsoft.VisualBasic.ChrW(48)))
            dmtfDateTime = String.Concat(dmtfDateTime, ".")
            Dim dtTemp As Date = New Date([date].Year, [date].Month, [date].Day, [date].Hour, [date].Minute, [date].Second, 0)
            Dim microsec As Long = CType(((([date].Ticks - dtTemp.Ticks) _
                        * 1000) _
                        / System.TimeSpan.TicksPerMillisecond), Long)
            Dim strMicrosec As String = CType(microsec, System.Int64).ToString
            If (strMicrosec.Length > 6) Then
                strMicrosec = strMicrosec.Substring(0, 6)
            End If
            dmtfDateTime = String.Concat(dmtfDateTime, strMicrosec.PadLeft(6, Global.Microsoft.VisualBasic.ChrW(48)))
            dmtfDateTime = String.Concat(dmtfDateTime, utcString)
            Return dmtfDateTime
        End Function

        Private Function ShouldSerializeDHCPLeaseExpires() As Boolean
            If (Me.IsDHCPLeaseExpiresNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeDHCPLeaseObtained() As Boolean
            If (Me.IsDHCPLeaseObtainedNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeDNSEnabledForWINSResolution() As Boolean
            If (Me.IsDNSEnabledForWINSResolutionNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeDomainDNSRegistrationEnabled() As Boolean
            If (Me.IsDomainDNSRegistrationEnabledNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeForwardBufferMemory() As Boolean
            If (Me.IsForwardBufferMemoryNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeFullDNSRegistrationEnabled() As Boolean
            If (Me.IsFullDNSRegistrationEnabledNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeIGMPLevel() As Boolean
            If (Me.IsIGMPLevelNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeIndex() As Boolean
            If (Me.IsIndexNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeInterfaceIndex() As Boolean
            If (Me.IsInterfaceIndexNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeIPConnectionMetric() As Boolean
            If (Me.IsIPConnectionMetricNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeIPEnabled() As Boolean
            If (Me.IsIPEnabledNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeIPFilterSecurityEnabled() As Boolean
            If (Me.IsIPFilterSecurityEnabledNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeIPPortSecurityEnabled() As Boolean
            If (Me.IsIPPortSecurityEnabledNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeIPUseZeroBroadcast() As Boolean
            If (Me.IsIPUseZeroBroadcastNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeIPXEnabled() As Boolean
            If (Me.IsIPXEnabledNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeIPXMediaType() As Boolean
            If (Me.IsIPXMediaTypeNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeKeepAliveInterval() As Boolean
            If (Me.IsKeepAliveIntervalNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeKeepAliveTime() As Boolean
            If (Me.IsKeepAliveTimeNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeMTU() As Boolean
            If (Me.IsMTUNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeNumForwardPackets() As Boolean
            If (Me.IsNumForwardPacketsNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializePMTUBHDetectEnabled() As Boolean
            If (Me.IsPMTUBHDetectEnabledNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializePMTUDiscoveryEnabled() As Boolean
            If (Me.IsPMTUDiscoveryEnabledNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeTcpipNetbiosOptions() As Boolean
            If (Me.IsTcpipNetbiosOptionsNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeTcpMaxConnectRetransmissions() As Boolean
            If (Me.IsTcpMaxConnectRetransmissionsNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeTcpMaxDataRetransmissions() As Boolean
            If (Me.IsTcpMaxDataRetransmissionsNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeTcpNumConnections() As Boolean
            If (Me.IsTcpNumConnectionsNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeTcpUseRFC1122UrgentPointer() As Boolean
            If (Me.IsTcpUseRFC1122UrgentPointerNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeTcpWindowSize() As Boolean
            If (Me.IsTcpWindowSizeNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeWINSEnableLMHostsLookup() As Boolean
            If (Me.IsWINSEnableLMHostsLookupNull = False) Then
                Return True
            End If
            Return False
        End Function

        <Browsable(True)> _
        Public Overloads Sub CommitObject()
            If (isEmbedded = False) Then
                PrivateLateBoundObject.Put()
            End If
        End Sub

        <Browsable(True)> _
        Public Overloads Sub CommitObject(ByVal putOptions As System.Management.PutOptions)
            If (isEmbedded = False) Then
                PrivateLateBoundObject.Put(putOptions)
            End If
        End Sub

        Private Sub Initialize()
            AutoCommitProp = True
            isEmbedded = False
        End Sub

        Private Shared Function ConstructPath(ByVal keyIndex As UInteger) As String
            Dim strPath As String = "root\cimv2:Win32_NetworkAdapterConfiguration"
            strPath = String.Concat(strPath, String.Concat(".Index=", CType(keyIndex, System.UInt32).ToString))
            Return strPath
        End Function

        Private Sub InitializeObject(ByVal mgmtScope As System.Management.ManagementScope, ByVal path As System.Management.ManagementPath, ByVal getOptions As System.Management.ObjectGetOptions)
            Initialize()
            If (Not (path) Is Nothing) Then
                If (CheckIfProperClass(mgmtScope, path, getOptions) <> True) Then
                    Throw New System.ArgumentException("Class name does not match.")
                End If
            End If
            PrivateLateBoundObject = New System.Management.ManagementObject(mgmtScope, path, getOptions)
            PrivateSystemProperties = New ManagementSystemProperties(PrivateLateBoundObject)
            curObj = PrivateLateBoundObject
        End Sub

        'Different overloads of GetInstances() help in enumerating instances of the WMI class.
        Public Overloads Shared Function GetInstances() As NetworkAdapterConfigurationCollection
            Return GetInstances(Nothing, Nothing, Nothing)
        End Function

        Public Overloads Shared Function GetInstances(ByVal condition As String) As NetworkAdapterConfigurationCollection
            Return GetInstances(Nothing, condition, Nothing)
        End Function

        Public Overloads Shared Function GetInstances(ByVal selectedProperties() As System.String) As NetworkAdapterConfigurationCollection
            Return GetInstances(Nothing, Nothing, selectedProperties)
        End Function

        Public Overloads Shared Function GetInstances(ByVal condition As String, ByVal selectedProperties() As System.String) As NetworkAdapterConfigurationCollection
            Return GetInstances(Nothing, condition, selectedProperties)
        End Function

        Public Overloads Shared Function GetInstances(ByVal mgmtScope As System.Management.ManagementScope, ByVal enumOptions As System.Management.EnumerationOptions) As NetworkAdapterConfigurationCollection
            If (mgmtScope Is Nothing) Then
                If (statMgmtScope Is Nothing) Then
                    mgmtScope = New System.Management.ManagementScope
                    mgmtScope.Path.NamespacePath = "root\cimv2"
                Else
                    mgmtScope = statMgmtScope
                End If
            End If
            Dim pathObj As System.Management.ManagementPath = New System.Management.ManagementPath
            pathObj.ClassName = "Win32_NetworkAdapterConfiguration"
            pathObj.NamespacePath = "root\cimv2"
            Dim clsObject As System.Management.ManagementClass = New System.Management.ManagementClass(mgmtScope, pathObj, Nothing)
            If (enumOptions Is Nothing) Then
                enumOptions = New System.Management.EnumerationOptions
                enumOptions.EnsureLocatable = True
            End If
            Return New NetworkAdapterConfigurationCollection(clsObject.GetInstances(enumOptions))
        End Function

        Public Overloads Shared Function GetInstances(ByVal mgmtScope As System.Management.ManagementScope, ByVal condition As String) As NetworkAdapterConfigurationCollection
            Return GetInstances(mgmtScope, condition, Nothing)
        End Function

        Public Overloads Shared Function GetInstances(ByVal mgmtScope As System.Management.ManagementScope, ByVal selectedProperties() As System.String) As NetworkAdapterConfigurationCollection
            Return GetInstances(mgmtScope, Nothing, selectedProperties)
        End Function

        Public Overloads Shared Function GetInstances(ByVal mgmtScope As System.Management.ManagementScope, ByVal condition As String, ByVal selectedProperties() As System.String) As NetworkAdapterConfigurationCollection
            If (mgmtScope Is Nothing) Then
                If (statMgmtScope Is Nothing) Then
                    mgmtScope = New System.Management.ManagementScope
                    mgmtScope.Path.NamespacePath = "root\cimv2"
                Else
                    mgmtScope = statMgmtScope
                End If
            End If
            Dim ObjectSearcher As System.Management.ManagementObjectSearcher = New System.Management.ManagementObjectSearcher(mgmtScope, New SelectQuery("Win32_NetworkAdapterConfiguration", condition, selectedProperties))
            Dim enumOptions As System.Management.EnumerationOptions = New System.Management.EnumerationOptions
            enumOptions.EnsureLocatable = True
            ObjectSearcher.Options = enumOptions
            Return New NetworkAdapterConfigurationCollection(ObjectSearcher.Get)
        End Function

        <Browsable(True)> _
        Public Shared Function CreateInstance() As NetworkAdapterConfiguration
            Dim mgmtScope As System.Management.ManagementScope = Nothing
            If (statMgmtScope Is Nothing) Then
                mgmtScope = New System.Management.ManagementScope
                mgmtScope.Path.NamespacePath = CreatedWmiNamespace
            Else
                mgmtScope = statMgmtScope
            End If
            Dim mgmtPath As System.Management.ManagementPath = New System.Management.ManagementPath(CreatedClassName)
            Dim tmpMgmtClass As System.Management.ManagementClass = New System.Management.ManagementClass(mgmtScope, mgmtPath, Nothing)
            Return New NetworkAdapterConfiguration(tmpMgmtClass.CreateInstance)
        End Function

        <Browsable(True)> _
        Public Sub Delete()
            PrivateLateBoundObject.Delete()
        End Sub

        Public Function DisableIPSec() As UInteger
            If (isEmbedded = False) Then
                Dim inParams As System.Management.ManagementBaseObject = Nothing
                Dim outParams As System.Management.ManagementBaseObject = PrivateLateBoundObject.InvokeMethod("DisableIPSec", inParams, Nothing)
                Return System.Convert.ToUInt32(outParams.Properties("ReturnValue").Value)
            Else
                Return System.Convert.ToUInt32(0)
            End If
        End Function

        Public Function EnableDHCP() As UInteger
            If (isEmbedded = False) Then
                Dim inParams As System.Management.ManagementBaseObject = Nothing
                Dim outParams As System.Management.ManagementBaseObject = PrivateLateBoundObject.InvokeMethod("EnableDHCP", inParams, Nothing)
                Return System.Convert.ToUInt32(outParams.Properties("ReturnValue").Value)
            Else
                Return System.Convert.ToUInt32(0)
            End If
        End Function

        Public Shared Function EnableDNS(ByVal DNSDomain As String, ByVal DNSDomainSuffixSearchOrder() As String, ByVal DNSHostName As String, ByVal DNSServerSearchOrder() As String) As UInteger
            Dim IsMethodStatic As Boolean = True
            If (IsMethodStatic = True) Then
                Dim inParams As System.Management.ManagementBaseObject = Nothing
                Dim mgmtPath As System.Management.ManagementPath = New System.Management.ManagementPath(CreatedClassName)
                Dim classObj As System.Management.ManagementClass = New System.Management.ManagementClass(statMgmtScope, mgmtPath, Nothing)
                inParams = classObj.GetMethodParameters("EnableDNS")
                inParams("DNSDomain") = CType(DNSDomain, System.String)
                inParams("DNSDomainSuffixSearchOrder") = CType(DNSDomainSuffixSearchOrder, String())
                inParams("DNSHostName") = CType(DNSHostName, System.String)
                inParams("DNSServerSearchOrder") = CType(DNSServerSearchOrder, String())
                Dim outParams As System.Management.ManagementBaseObject = classObj.InvokeMethod("EnableDNS", inParams, Nothing)
                Return System.Convert.ToUInt32(outParams.Properties("ReturnValue").Value)
            Else
                Return System.Convert.ToUInt32(0)
            End If
        End Function

        Public Shared Function EnableIPFilterSec(ByVal IPFilterSecurityEnabled As Boolean) As UInteger
            Dim IsMethodStatic As Boolean = True
            If (IsMethodStatic = True) Then
                Dim inParams As System.Management.ManagementBaseObject = Nothing
                Dim mgmtPath As System.Management.ManagementPath = New System.Management.ManagementPath(CreatedClassName)
                Dim classObj As System.Management.ManagementClass = New System.Management.ManagementClass(statMgmtScope, mgmtPath, Nothing)
                inParams = classObj.GetMethodParameters("EnableIPFilterSec")
                inParams("IPFilterSecurityEnabled") = CType(IPFilterSecurityEnabled, System.Boolean)
                Dim outParams As System.Management.ManagementBaseObject = classObj.InvokeMethod("EnableIPFilterSec", inParams, Nothing)
                Return System.Convert.ToUInt32(outParams.Properties("ReturnValue").Value)
            Else
                Return System.Convert.ToUInt32(0)
            End If
        End Function

        Public Function EnableIPSec(ByVal IPSecPermitIPProtocols() As String, ByVal IPSecPermitTCPPorts() As String, ByVal IPSecPermitUDPPorts() As String) As UInteger
            If (isEmbedded = False) Then
                Dim inParams As System.Management.ManagementBaseObject = Nothing
                inParams = PrivateLateBoundObject.GetMethodParameters("EnableIPSec")
                inParams("IPSecPermitIPProtocols") = CType(IPSecPermitIPProtocols, String())
                inParams("IPSecPermitTCPPorts") = CType(IPSecPermitTCPPorts, String())
                inParams("IPSecPermitUDPPorts") = CType(IPSecPermitUDPPorts, String())
                Dim outParams As System.Management.ManagementBaseObject = PrivateLateBoundObject.InvokeMethod("EnableIPSec", inParams, Nothing)
                Return System.Convert.ToUInt32(outParams.Properties("ReturnValue").Value)
            Else
                Return System.Convert.ToUInt32(0)
            End If
        End Function

        Public Function EnableStatic(ByVal IPAddress() As String, ByVal SubnetMask() As String) As UInteger
            If (isEmbedded = False) Then
                Dim inParams As System.Management.ManagementBaseObject = Nothing
                inParams = PrivateLateBoundObject.GetMethodParameters("EnableStatic")
                inParams("IPAddress") = CType(IPAddress, String())
                inParams("SubnetMask") = CType(SubnetMask, String())
                Dim outParams As System.Management.ManagementBaseObject = PrivateLateBoundObject.InvokeMethod("EnableStatic", inParams, Nothing)
                Return System.Convert.ToUInt32(outParams.Properties("ReturnValue").Value)
            Else
                Return System.Convert.ToUInt32(0)
            End If
        End Function

        Public Shared Function EnableWINS(ByVal DNSEnabledForWINSResolution As Boolean, ByVal WINSEnableLMHostsLookup As Boolean, ByVal WINSHostLookupFile As String, ByVal WINSScopeID As String) As UInteger
            Dim IsMethodStatic As Boolean = True
            If (IsMethodStatic = True) Then
                Dim inParams As System.Management.ManagementBaseObject = Nothing
                Dim mgmtPath As System.Management.ManagementPath = New System.Management.ManagementPath(CreatedClassName)
                Dim classObj As System.Management.ManagementClass = New System.Management.ManagementClass(statMgmtScope, mgmtPath, Nothing)
                inParams = classObj.GetMethodParameters("EnableWINS")
                inParams("DNSEnabledForWINSResolution") = CType(DNSEnabledForWINSResolution, System.Boolean)
                inParams("WINSEnableLMHostsLookup") = CType(WINSEnableLMHostsLookup, System.Boolean)
                inParams("WINSHostLookupFile") = CType(WINSHostLookupFile, System.String)
                inParams("WINSScopeID") = CType(WINSScopeID, System.String)
                Dim outParams As System.Management.ManagementBaseObject = classObj.InvokeMethod("EnableWINS", inParams, Nothing)
                Return System.Convert.ToUInt32(outParams.Properties("ReturnValue").Value)
            Else
                Return System.Convert.ToUInt32(0)
            End If
        End Function

        Public Function ReleaseDHCPLease() As UInteger
            If (isEmbedded = False) Then
                Dim inParams As System.Management.ManagementBaseObject = Nothing
                Dim outParams As System.Management.ManagementBaseObject = PrivateLateBoundObject.InvokeMethod("ReleaseDHCPLease", inParams, Nothing)
                Return System.Convert.ToUInt32(outParams.Properties("ReturnValue").Value)
            Else
                Return System.Convert.ToUInt32(0)
            End If
        End Function

        Public Shared Function ReleaseDHCPLeaseAll() As UInteger
            Dim IsMethodStatic As Boolean = True
            If (IsMethodStatic = True) Then
                Dim inParams As System.Management.ManagementBaseObject = Nothing
                Dim mgmtPath As System.Management.ManagementPath = New System.Management.ManagementPath(CreatedClassName)
                Dim classObj As System.Management.ManagementClass = New System.Management.ManagementClass(statMgmtScope, mgmtPath, Nothing)
                Dim outParams As System.Management.ManagementBaseObject = classObj.InvokeMethod("ReleaseDHCPLeaseAll", inParams, Nothing)
                Return System.Convert.ToUInt32(outParams.Properties("ReturnValue").Value)
            Else
                Return System.Convert.ToUInt32(0)
            End If
        End Function

        Public Function RenewDHCPLease() As UInteger
            If (isEmbedded = False) Then
                Dim inParams As System.Management.ManagementBaseObject = Nothing
                Dim outParams As System.Management.ManagementBaseObject = PrivateLateBoundObject.InvokeMethod("RenewDHCPLease", inParams, Nothing)
                Return System.Convert.ToUInt32(outParams.Properties("ReturnValue").Value)
            Else
                Return System.Convert.ToUInt32(0)
            End If
        End Function

        Public Shared Function RenewDHCPLeaseAll() As UInteger
            Dim IsMethodStatic As Boolean = True
            If (IsMethodStatic = True) Then
                Dim inParams As System.Management.ManagementBaseObject = Nothing
                Dim mgmtPath As System.Management.ManagementPath = New System.Management.ManagementPath(CreatedClassName)
                Dim classObj As System.Management.ManagementClass = New System.Management.ManagementClass(statMgmtScope, mgmtPath, Nothing)
                Dim outParams As System.Management.ManagementBaseObject = classObj.InvokeMethod("RenewDHCPLeaseAll", inParams, Nothing)
                Return System.Convert.ToUInt32(outParams.Properties("ReturnValue").Value)
            Else
                Return System.Convert.ToUInt32(0)
            End If
        End Function

        Public Shared Function SetArpAlwaysSourceRoute(ByVal ArpAlwaysSourceRoute As Boolean) As UInteger
            Dim IsMethodStatic As Boolean = True
            If (IsMethodStatic = True) Then
                Dim inParams As System.Management.ManagementBaseObject = Nothing
                Dim mgmtPath As System.Management.ManagementPath = New System.Management.ManagementPath(CreatedClassName)
                Dim classObj As System.Management.ManagementClass = New System.Management.ManagementClass(statMgmtScope, mgmtPath, Nothing)
                inParams = classObj.GetMethodParameters("SetArpAlwaysSourceRoute")
                inParams("ArpAlwaysSourceRoute") = CType(ArpAlwaysSourceRoute, System.Boolean)
                Dim outParams As System.Management.ManagementBaseObject = classObj.InvokeMethod("SetArpAlwaysSourceRoute", inParams, Nothing)
                Return System.Convert.ToUInt32(outParams.Properties("ReturnValue").Value)
            Else
                Return System.Convert.ToUInt32(0)
            End If
        End Function

        Public Shared Function SetArpUseEtherSNAP(ByVal ArpUseEtherSNAP As Boolean) As UInteger
            Dim IsMethodStatic As Boolean = True
            If (IsMethodStatic = True) Then
                Dim inParams As System.Management.ManagementBaseObject = Nothing
                Dim mgmtPath As System.Management.ManagementPath = New System.Management.ManagementPath(CreatedClassName)
                Dim classObj As System.Management.ManagementClass = New System.Management.ManagementClass(statMgmtScope, mgmtPath, Nothing)
                inParams = classObj.GetMethodParameters("SetArpUseEtherSNAP")
                inParams("ArpUseEtherSNAP") = CType(ArpUseEtherSNAP, System.Boolean)
                Dim outParams As System.Management.ManagementBaseObject = classObj.InvokeMethod("SetArpUseEtherSNAP", inParams, Nothing)
                Return System.Convert.ToUInt32(outParams.Properties("ReturnValue").Value)
            Else
                Return System.Convert.ToUInt32(0)
            End If
        End Function

        Public Shared Function SetDatabasePath(ByVal DatabasePath As String) As UInteger
            Dim IsMethodStatic As Boolean = True
            If (IsMethodStatic = True) Then
                Dim inParams As System.Management.ManagementBaseObject = Nothing
                Dim mgmtPath As System.Management.ManagementPath = New System.Management.ManagementPath(CreatedClassName)
                Dim classObj As System.Management.ManagementClass = New System.Management.ManagementClass(statMgmtScope, mgmtPath, Nothing)
                inParams = classObj.GetMethodParameters("SetDatabasePath")
                inParams("DatabasePath") = CType(DatabasePath, System.String)
                Dim outParams As System.Management.ManagementBaseObject = classObj.InvokeMethod("SetDatabasePath", inParams, Nothing)
                Return System.Convert.ToUInt32(outParams.Properties("ReturnValue").Value)
            Else
                Return System.Convert.ToUInt32(0)
            End If
        End Function

        Public Shared Function SetDeadGWDetect(ByVal DeadGWDetectEnabled As Boolean) As UInteger
            Dim IsMethodStatic As Boolean = True
            If (IsMethodStatic = True) Then
                Dim inParams As System.Management.ManagementBaseObject = Nothing
                Dim mgmtPath As System.Management.ManagementPath = New System.Management.ManagementPath(CreatedClassName)
                Dim classObj As System.Management.ManagementClass = New System.Management.ManagementClass(statMgmtScope, mgmtPath, Nothing)
                inParams = classObj.GetMethodParameters("SetDeadGWDetect")
                inParams("DeadGWDetectEnabled") = CType(DeadGWDetectEnabled, System.Boolean)
                Dim outParams As System.Management.ManagementBaseObject = classObj.InvokeMethod("SetDeadGWDetect", inParams, Nothing)
                Return System.Convert.ToUInt32(outParams.Properties("ReturnValue").Value)
            Else
                Return System.Convert.ToUInt32(0)
            End If
        End Function

        Public Shared Function SetDefaultTOS(ByVal DefaultTOS As Byte) As UInteger
            Dim IsMethodStatic As Boolean = True
            If (IsMethodStatic = True) Then
                Dim inParams As System.Management.ManagementBaseObject = Nothing
                Dim mgmtPath As System.Management.ManagementPath = New System.Management.ManagementPath(CreatedClassName)
                Dim classObj As System.Management.ManagementClass = New System.Management.ManagementClass(statMgmtScope, mgmtPath, Nothing)
                inParams = classObj.GetMethodParameters("SetDefaultTOS")
                inParams("DefaultTOS") = CType(DefaultTOS, System.Byte)
                Dim outParams As System.Management.ManagementBaseObject = classObj.InvokeMethod("SetDefaultTOS", inParams, Nothing)
                Return System.Convert.ToUInt32(outParams.Properties("ReturnValue").Value)
            Else
                Return System.Convert.ToUInt32(0)
            End If
        End Function

        Public Shared Function SetDefaultTTL(ByVal DefaultTTL As Byte) As UInteger
            Dim IsMethodStatic As Boolean = True
            If (IsMethodStatic = True) Then
                Dim inParams As System.Management.ManagementBaseObject = Nothing
                Dim mgmtPath As System.Management.ManagementPath = New System.Management.ManagementPath(CreatedClassName)
                Dim classObj As System.Management.ManagementClass = New System.Management.ManagementClass(statMgmtScope, mgmtPath, Nothing)
                inParams = classObj.GetMethodParameters("SetDefaultTTL")
                inParams("DefaultTTL") = CType(DefaultTTL, System.Byte)
                Dim outParams As System.Management.ManagementBaseObject = classObj.InvokeMethod("SetDefaultTTL", inParams, Nothing)
                Return System.Convert.ToUInt32(outParams.Properties("ReturnValue").Value)
            Else
                Return System.Convert.ToUInt32(0)
            End If
        End Function

        Public Function SetDNSDomain(ByVal DNSDomain As String) As UInteger
            If (isEmbedded = False) Then
                Dim inParams As System.Management.ManagementBaseObject = Nothing
                inParams = PrivateLateBoundObject.GetMethodParameters("SetDNSDomain")
                inParams("DNSDomain") = CType(DNSDomain, System.String)
                Dim outParams As System.Management.ManagementBaseObject = PrivateLateBoundObject.InvokeMethod("SetDNSDomain", inParams, Nothing)
                Return System.Convert.ToUInt32(outParams.Properties("ReturnValue").Value)
            Else
                Return System.Convert.ToUInt32(0)
            End If
        End Function

        Public Function SetDNSServerSearchOrder(ByVal DNSServerSearchOrder() As String) As UInteger
            If (isEmbedded = False) Then
                Dim inParams As System.Management.ManagementBaseObject = Nothing
                inParams = PrivateLateBoundObject.GetMethodParameters("SetDNSServerSearchOrder")
                inParams("DNSServerSearchOrder") = CType(DNSServerSearchOrder, String())
                Dim outParams As System.Management.ManagementBaseObject = PrivateLateBoundObject.InvokeMethod("SetDNSServerSearchOrder", inParams, Nothing)
                Return System.Convert.ToUInt32(outParams.Properties("ReturnValue").Value)
            Else
                Return System.Convert.ToUInt32(0)
            End If
        End Function

        Public Shared Function SetDNSSuffixSearchOrder(ByVal DNSDomainSuffixSearchOrder() As String) As UInteger
            Dim IsMethodStatic As Boolean = True
            If (IsMethodStatic = True) Then
                Dim inParams As System.Management.ManagementBaseObject = Nothing
                Dim mgmtPath As System.Management.ManagementPath = New System.Management.ManagementPath(CreatedClassName)
                Dim classObj As System.Management.ManagementClass = New System.Management.ManagementClass(statMgmtScope, mgmtPath, Nothing)
                inParams = classObj.GetMethodParameters("SetDNSSuffixSearchOrder")
                inParams("DNSDomainSuffixSearchOrder") = CType(DNSDomainSuffixSearchOrder, String())
                Dim outParams As System.Management.ManagementBaseObject = classObj.InvokeMethod("SetDNSSuffixSearchOrder", inParams, Nothing)
                Return System.Convert.ToUInt32(outParams.Properties("ReturnValue").Value)
            Else
                Return System.Convert.ToUInt32(0)
            End If
        End Function

        Public Function SetDynamicDNSRegistration(ByVal DomainDNSRegistrationEnabled As Boolean, ByVal FullDNSRegistrationEnabled As Boolean) As UInteger
            If (isEmbedded = False) Then
                Dim inParams As System.Management.ManagementBaseObject = Nothing
                inParams = PrivateLateBoundObject.GetMethodParameters("SetDynamicDNSRegistration")
                inParams("DomainDNSRegistrationEnabled") = CType(DomainDNSRegistrationEnabled, System.Boolean)
                inParams("FullDNSRegistrationEnabled") = CType(FullDNSRegistrationEnabled, System.Boolean)
                Dim outParams As System.Management.ManagementBaseObject = PrivateLateBoundObject.InvokeMethod("SetDynamicDNSRegistration", inParams, Nothing)
                Return System.Convert.ToUInt32(outParams.Properties("ReturnValue").Value)
            Else
                Return System.Convert.ToUInt32(0)
            End If
        End Function

        Public Shared Function SetForwardBufferMemory(ByVal ForwardBufferMemory As UInteger) As UInteger
            Dim IsMethodStatic As Boolean = True
            If (IsMethodStatic = True) Then
                Dim inParams As System.Management.ManagementBaseObject = Nothing
                Dim mgmtPath As System.Management.ManagementPath = New System.Management.ManagementPath(CreatedClassName)
                Dim classObj As System.Management.ManagementClass = New System.Management.ManagementClass(statMgmtScope, mgmtPath, Nothing)
                inParams = classObj.GetMethodParameters("SetForwardBufferMemory")
                inParams("ForwardBufferMemory") = CType(ForwardBufferMemory, System.UInt32)
                Dim outParams As System.Management.ManagementBaseObject = classObj.InvokeMethod("SetForwardBufferMemory", inParams, Nothing)
                Return System.Convert.ToUInt32(outParams.Properties("ReturnValue").Value)
            Else
                Return System.Convert.ToUInt32(0)
            End If
        End Function

        Public Function SetGateways(ByVal DefaultIPGateway() As String, ByVal GatewayCostMetric() As UShort) As UInteger
            If (isEmbedded = False) Then
                Dim inParams As System.Management.ManagementBaseObject = Nothing
                inParams = PrivateLateBoundObject.GetMethodParameters("SetGateways")
                inParams("DefaultIPGateway") = CType(DefaultIPGateway, String())
                inParams("GatewayCostMetric") = CType(GatewayCostMetric, UShort())
                Dim outParams As System.Management.ManagementBaseObject = PrivateLateBoundObject.InvokeMethod("SetGateways", inParams, Nothing)
                Return System.Convert.ToUInt32(outParams.Properties("ReturnValue").Value)
            Else
                Return System.Convert.ToUInt32(0)
            End If
        End Function

        Public Shared Function SetIGMPLevel(ByVal IGMPLevel As Byte) As UInteger
            Dim IsMethodStatic As Boolean = True
            If (IsMethodStatic = True) Then
                Dim inParams As System.Management.ManagementBaseObject = Nothing
                Dim mgmtPath As System.Management.ManagementPath = New System.Management.ManagementPath(CreatedClassName)
                Dim classObj As System.Management.ManagementClass = New System.Management.ManagementClass(statMgmtScope, mgmtPath, Nothing)
                inParams = classObj.GetMethodParameters("SetIGMPLevel")
                inParams("IGMPLevel") = CType(IGMPLevel, System.Byte)
                Dim outParams As System.Management.ManagementBaseObject = classObj.InvokeMethod("SetIGMPLevel", inParams, Nothing)
                Return System.Convert.ToUInt32(outParams.Properties("ReturnValue").Value)
            Else
                Return System.Convert.ToUInt32(0)
            End If
        End Function

        Public Function SetIPConnectionMetric(ByVal IPConnectionMetric As UInteger) As UInteger
            If (isEmbedded = False) Then
                Dim inParams As System.Management.ManagementBaseObject = Nothing
                inParams = PrivateLateBoundObject.GetMethodParameters("SetIPConnectionMetric")
                inParams("IPConnectionMetric") = CType(IPConnectionMetric, System.UInt32)
                Dim outParams As System.Management.ManagementBaseObject = PrivateLateBoundObject.InvokeMethod("SetIPConnectionMetric", inParams, Nothing)
                Return System.Convert.ToUInt32(outParams.Properties("ReturnValue").Value)
            Else
                Return System.Convert.ToUInt32(0)
            End If
        End Function

        Public Shared Function SetIPUseZeroBroadcast(ByVal IPUseZeroBroadcast As Boolean) As UInteger
            Dim IsMethodStatic As Boolean = True
            If (IsMethodStatic = True) Then
                Dim inParams As System.Management.ManagementBaseObject = Nothing
                Dim mgmtPath As System.Management.ManagementPath = New System.Management.ManagementPath(CreatedClassName)
                Dim classObj As System.Management.ManagementClass = New System.Management.ManagementClass(statMgmtScope, mgmtPath, Nothing)
                inParams = classObj.GetMethodParameters("SetIPUseZeroBroadcast")
                inParams("IPUseZeroBroadcast") = CType(IPUseZeroBroadcast, System.Boolean)
                Dim outParams As System.Management.ManagementBaseObject = classObj.InvokeMethod("SetIPUseZeroBroadcast", inParams, Nothing)
                Return System.Convert.ToUInt32(outParams.Properties("ReturnValue").Value)
            Else
                Return System.Convert.ToUInt32(0)
            End If
        End Function

        Public Function SetIPXFrameTypeNetworkPairs(ByVal IPXFrameType() As UInteger, ByVal IPXNetworkNumber() As String) As UInteger
            If (isEmbedded = False) Then
                Dim inParams As System.Management.ManagementBaseObject = Nothing
                inParams = PrivateLateBoundObject.GetMethodParameters("SetIPXFrameTypeNetworkPairs")
                inParams("IPXFrameType") = CType(IPXFrameType, UInteger())
                inParams("IPXNetworkNumber") = CType(IPXNetworkNumber, String())
                Dim outParams As System.Management.ManagementBaseObject = PrivateLateBoundObject.InvokeMethod("SetIPXFrameTypeNetworkPairs", inParams, Nothing)
                Return System.Convert.ToUInt32(outParams.Properties("ReturnValue").Value)
            Else
                Return System.Convert.ToUInt32(0)
            End If
        End Function

        Public Shared Function SetIPXVirtualNetworkNumber(ByVal IPXVirtualNetNumber As String) As UInteger
            Dim IsMethodStatic As Boolean = True
            If (IsMethodStatic = True) Then
                Dim inParams As System.Management.ManagementBaseObject = Nothing
                Dim mgmtPath As System.Management.ManagementPath = New System.Management.ManagementPath(CreatedClassName)
                Dim classObj As System.Management.ManagementClass = New System.Management.ManagementClass(statMgmtScope, mgmtPath, Nothing)
                inParams = classObj.GetMethodParameters("SetIPXVirtualNetworkNumber")
                inParams("IPXVirtualNetNumber") = CType(IPXVirtualNetNumber, System.String)
                Dim outParams As System.Management.ManagementBaseObject = classObj.InvokeMethod("SetIPXVirtualNetworkNumber", inParams, Nothing)
                Return System.Convert.ToUInt32(outParams.Properties("ReturnValue").Value)
            Else
                Return System.Convert.ToUInt32(0)
            End If
        End Function

        Public Shared Function SetKeepAliveInterval(ByVal KeepAliveInterval As UInteger) As UInteger
            Dim IsMethodStatic As Boolean = True
            If (IsMethodStatic = True) Then
                Dim inParams As System.Management.ManagementBaseObject = Nothing
                Dim mgmtPath As System.Management.ManagementPath = New System.Management.ManagementPath(CreatedClassName)
                Dim classObj As System.Management.ManagementClass = New System.Management.ManagementClass(statMgmtScope, mgmtPath, Nothing)
                inParams = classObj.GetMethodParameters("SetKeepAliveInterval")
                inParams("KeepAliveInterval") = CType(KeepAliveInterval, System.UInt32)
                Dim outParams As System.Management.ManagementBaseObject = classObj.InvokeMethod("SetKeepAliveInterval", inParams, Nothing)
                Return System.Convert.ToUInt32(outParams.Properties("ReturnValue").Value)
            Else
                Return System.Convert.ToUInt32(0)
            End If
        End Function

        Public Shared Function SetKeepAliveTime(ByVal KeepAliveTime As UInteger) As UInteger
            Dim IsMethodStatic As Boolean = True
            If (IsMethodStatic = True) Then
                Dim inParams As System.Management.ManagementBaseObject = Nothing
                Dim mgmtPath As System.Management.ManagementPath = New System.Management.ManagementPath(CreatedClassName)
                Dim classObj As System.Management.ManagementClass = New System.Management.ManagementClass(statMgmtScope, mgmtPath, Nothing)
                inParams = classObj.GetMethodParameters("SetKeepAliveTime")
                inParams("KeepAliveTime") = CType(KeepAliveTime, System.UInt32)
                Dim outParams As System.Management.ManagementBaseObject = classObj.InvokeMethod("SetKeepAliveTime", inParams, Nothing)
                Return System.Convert.ToUInt32(outParams.Properties("ReturnValue").Value)
            Else
                Return System.Convert.ToUInt32(0)
            End If
        End Function

        Public Shared Function SetMTU(ByVal MTU As UInteger) As UInteger
            Dim IsMethodStatic As Boolean = True
            If (IsMethodStatic = True) Then
                Dim inParams As System.Management.ManagementBaseObject = Nothing
                Dim mgmtPath As System.Management.ManagementPath = New System.Management.ManagementPath(CreatedClassName)
                Dim classObj As System.Management.ManagementClass = New System.Management.ManagementClass(statMgmtScope, mgmtPath, Nothing)
                inParams = classObj.GetMethodParameters("SetMTU")
                inParams("MTU") = CType(MTU, System.UInt32)
                Dim outParams As System.Management.ManagementBaseObject = classObj.InvokeMethod("SetMTU", inParams, Nothing)
                Return System.Convert.ToUInt32(outParams.Properties("ReturnValue").Value)
            Else
                Return System.Convert.ToUInt32(0)
            End If
        End Function

        Public Shared Function SetNumForwardPackets(ByVal NumForwardPackets As UInteger) As UInteger
            Dim IsMethodStatic As Boolean = True
            If (IsMethodStatic = True) Then
                Dim inParams As System.Management.ManagementBaseObject = Nothing
                Dim mgmtPath As System.Management.ManagementPath = New System.Management.ManagementPath(CreatedClassName)
                Dim classObj As System.Management.ManagementClass = New System.Management.ManagementClass(statMgmtScope, mgmtPath, Nothing)
                inParams = classObj.GetMethodParameters("SetNumForwardPackets")
                inParams("NumForwardPackets") = CType(NumForwardPackets, System.UInt32)
                Dim outParams As System.Management.ManagementBaseObject = classObj.InvokeMethod("SetNumForwardPackets", inParams, Nothing)
                Return System.Convert.ToUInt32(outParams.Properties("ReturnValue").Value)
            Else
                Return System.Convert.ToUInt32(0)
            End If
        End Function

        Public Shared Function SetPMTUBHDetect(ByVal PMTUBHDetectEnabled As Boolean) As UInteger
            Dim IsMethodStatic As Boolean = True
            If (IsMethodStatic = True) Then
                Dim inParams As System.Management.ManagementBaseObject = Nothing
                Dim mgmtPath As System.Management.ManagementPath = New System.Management.ManagementPath(CreatedClassName)
                Dim classObj As System.Management.ManagementClass = New System.Management.ManagementClass(statMgmtScope, mgmtPath, Nothing)
                inParams = classObj.GetMethodParameters("SetPMTUBHDetect")
                inParams("PMTUBHDetectEnabled") = CType(PMTUBHDetectEnabled, System.Boolean)
                Dim outParams As System.Management.ManagementBaseObject = classObj.InvokeMethod("SetPMTUBHDetect", inParams, Nothing)
                Return System.Convert.ToUInt32(outParams.Properties("ReturnValue").Value)
            Else
                Return System.Convert.ToUInt32(0)
            End If
        End Function

        Public Shared Function SetPMTUDiscovery(ByVal PMTUDiscoveryEnabled As Boolean) As UInteger
            Dim IsMethodStatic As Boolean = True
            If (IsMethodStatic = True) Then
                Dim inParams As System.Management.ManagementBaseObject = Nothing
                Dim mgmtPath As System.Management.ManagementPath = New System.Management.ManagementPath(CreatedClassName)
                Dim classObj As System.Management.ManagementClass = New System.Management.ManagementClass(statMgmtScope, mgmtPath, Nothing)
                inParams = classObj.GetMethodParameters("SetPMTUDiscovery")
                inParams("PMTUDiscoveryEnabled") = CType(PMTUDiscoveryEnabled, System.Boolean)
                Dim outParams As System.Management.ManagementBaseObject = classObj.InvokeMethod("SetPMTUDiscovery", inParams, Nothing)
                Return System.Convert.ToUInt32(outParams.Properties("ReturnValue").Value)
            Else
                Return System.Convert.ToUInt32(0)
            End If
        End Function

        Public Function SetTcpipNetbios(ByVal TcpipNetbiosOptions As UInteger) As UInteger
            If (isEmbedded = False) Then
                Dim inParams As System.Management.ManagementBaseObject = Nothing
                inParams = PrivateLateBoundObject.GetMethodParameters("SetTcpipNetbios")
                inParams("TcpipNetbiosOptions") = CType(TcpipNetbiosOptions, System.UInt32)
                Dim outParams As System.Management.ManagementBaseObject = PrivateLateBoundObject.InvokeMethod("SetTcpipNetbios", inParams, Nothing)
                Return System.Convert.ToUInt32(outParams.Properties("ReturnValue").Value)
            Else
                Return System.Convert.ToUInt32(0)
            End If
        End Function

        Public Shared Function SetTcpMaxConnectRetransmissions(ByVal TcpMaxConnectRetransmissions As UInteger) As UInteger
            Dim IsMethodStatic As Boolean = True
            If (IsMethodStatic = True) Then
                Dim inParams As System.Management.ManagementBaseObject = Nothing
                Dim mgmtPath As System.Management.ManagementPath = New System.Management.ManagementPath(CreatedClassName)
                Dim classObj As System.Management.ManagementClass = New System.Management.ManagementClass(statMgmtScope, mgmtPath, Nothing)
                inParams = classObj.GetMethodParameters("SetTcpMaxConnectRetransmissions")
                inParams("TcpMaxConnectRetransmissions") = CType(TcpMaxConnectRetransmissions, System.UInt32)
                Dim outParams As System.Management.ManagementBaseObject = classObj.InvokeMethod("SetTcpMaxConnectRetransmissions", inParams, Nothing)
                Return System.Convert.ToUInt32(outParams.Properties("ReturnValue").Value)
            Else
                Return System.Convert.ToUInt32(0)
            End If
        End Function

        Public Shared Function SetTcpMaxDataRetransmissions(ByVal TcpMaxDataRetransmissions As UInteger) As UInteger
            Dim IsMethodStatic As Boolean = True
            If (IsMethodStatic = True) Then
                Dim inParams As System.Management.ManagementBaseObject = Nothing
                Dim mgmtPath As System.Management.ManagementPath = New System.Management.ManagementPath(CreatedClassName)
                Dim classObj As System.Management.ManagementClass = New System.Management.ManagementClass(statMgmtScope, mgmtPath, Nothing)
                inParams = classObj.GetMethodParameters("SetTcpMaxDataRetransmissions")
                inParams("TcpMaxDataRetransmissions") = CType(TcpMaxDataRetransmissions, System.UInt32)
                Dim outParams As System.Management.ManagementBaseObject = classObj.InvokeMethod("SetTcpMaxDataRetransmissions", inParams, Nothing)
                Return System.Convert.ToUInt32(outParams.Properties("ReturnValue").Value)
            Else
                Return System.Convert.ToUInt32(0)
            End If
        End Function

        Public Shared Function SetTcpNumConnections(ByVal TcpNumConnections As UInteger) As UInteger
            Dim IsMethodStatic As Boolean = True
            If (IsMethodStatic = True) Then
                Dim inParams As System.Management.ManagementBaseObject = Nothing
                Dim mgmtPath As System.Management.ManagementPath = New System.Management.ManagementPath(CreatedClassName)
                Dim classObj As System.Management.ManagementClass = New System.Management.ManagementClass(statMgmtScope, mgmtPath, Nothing)
                inParams = classObj.GetMethodParameters("SetTcpNumConnections")
                inParams("TcpNumConnections") = CType(TcpNumConnections, System.UInt32)
                Dim outParams As System.Management.ManagementBaseObject = classObj.InvokeMethod("SetTcpNumConnections", inParams, Nothing)
                Return System.Convert.ToUInt32(outParams.Properties("ReturnValue").Value)
            Else
                Return System.Convert.ToUInt32(0)
            End If
        End Function

        Public Shared Function SetTcpUseRFC1122UrgentPointer(ByVal TcpUseRFC1122UrgentPointer As Boolean) As UInteger
            Dim IsMethodStatic As Boolean = True
            If (IsMethodStatic = True) Then
                Dim inParams As System.Management.ManagementBaseObject = Nothing
                Dim mgmtPath As System.Management.ManagementPath = New System.Management.ManagementPath(CreatedClassName)
                Dim classObj As System.Management.ManagementClass = New System.Management.ManagementClass(statMgmtScope, mgmtPath, Nothing)
                inParams = classObj.GetMethodParameters("SetTcpUseRFC1122UrgentPointer")
                inParams("TcpUseRFC1122UrgentPointer") = CType(TcpUseRFC1122UrgentPointer, System.Boolean)
                Dim outParams As System.Management.ManagementBaseObject = classObj.InvokeMethod("SetTcpUseRFC1122UrgentPointer", inParams, Nothing)
                Return System.Convert.ToUInt32(outParams.Properties("ReturnValue").Value)
            Else
                Return System.Convert.ToUInt32(0)
            End If
        End Function

        Public Shared Function SetTcpWindowSize(ByVal TcpWindowSize As UShort) As UInteger
            Dim IsMethodStatic As Boolean = True
            If (IsMethodStatic = True) Then
                Dim inParams As System.Management.ManagementBaseObject = Nothing
                Dim mgmtPath As System.Management.ManagementPath = New System.Management.ManagementPath(CreatedClassName)
                Dim classObj As System.Management.ManagementClass = New System.Management.ManagementClass(statMgmtScope, mgmtPath, Nothing)
                inParams = classObj.GetMethodParameters("SetTcpWindowSize")
                inParams("TcpWindowSize") = CType(TcpWindowSize, System.UInt16)
                Dim outParams As System.Management.ManagementBaseObject = classObj.InvokeMethod("SetTcpWindowSize", inParams, Nothing)
                Return System.Convert.ToUInt32(outParams.Properties("ReturnValue").Value)
            Else
                Return System.Convert.ToUInt32(0)
            End If
        End Function

        Public Function SetWINSServer(ByVal WINSPrimaryServer As String, ByVal WINSSecondaryServer As String) As UInteger
            If (isEmbedded = False) Then
                Dim inParams As System.Management.ManagementBaseObject = Nothing
                inParams = PrivateLateBoundObject.GetMethodParameters("SetWINSServer")
                inParams("WINSPrimaryServer") = CType(WINSPrimaryServer, System.String)
                inParams("WINSSecondaryServer") = CType(WINSSecondaryServer, System.String)
                Dim outParams As System.Management.ManagementBaseObject = PrivateLateBoundObject.InvokeMethod("SetWINSServer", inParams, Nothing)
                Return System.Convert.ToUInt32(outParams.Properties("ReturnValue").Value)
            Else
                Return System.Convert.ToUInt32(0)
            End If
        End Function

        Public Enum IGMPLevelValues

            No_Multicast = 0

            IP_Multicast = 1

            IP_IGMP_multicast = 2

            NULL_ENUM_VALUE = 3
        End Enum

        Public Enum IPXFrameTypeValues

            Ethernet_II = 0

            Ethernet_802_3 = 1

            Ethernet_802_2 = 2

            Ethernet_SNAP = 3

            [AUTO] = 255

            NULL_ENUM_VALUE = 256
        End Enum

        Public Enum IPXMediaTypeValues

            Ethernet = 1

            Token_ring = 2

            FDDI = 3

            ARCNET = 8

            NULL_ENUM_VALUE = 0
        End Enum

        Public Enum TcpipNetbiosOptionsValues

            EnableNetbiosViaDhcp = 0

            EnableNetbios = 1

            DisableNetbios = 2

            NULL_ENUM_VALUE = 3
        End Enum

        'Enumerator implementation for enumerating instances of the class.
        Public Class NetworkAdapterConfigurationCollection
            Inherits Object
            Implements ICollection

            Private privColObj As ManagementObjectCollection

            Public Sub New(ByVal objCollection As ManagementObjectCollection)
                MyBase.New()
                privColObj = objCollection
            End Sub

            Public Overridable ReadOnly Property Count() As Integer Implements System.Collections.ICollection.Count
                Get
                    Return privColObj.Count
                End Get
            End Property

            Public Overridable ReadOnly Property IsSynchronized() As Boolean Implements System.Collections.ICollection.IsSynchronized
                Get
                    Return privColObj.IsSynchronized
                End Get
            End Property

            Public Overridable ReadOnly Property SyncRoot() As Object Implements System.Collections.ICollection.SyncRoot
                Get
                    Return Me
                End Get
            End Property

            Public Overridable Sub CopyTo(ByVal array As System.Array, ByVal index As Integer) Implements System.Collections.ICollection.CopyTo
                privColObj.CopyTo(array, index)
                Dim nCtr As Integer
                nCtr = 0
                Do While (nCtr < array.Length)
                    array.SetValue(New NetworkAdapterConfiguration(CType(array.GetValue(nCtr), System.Management.ManagementObject)), nCtr)
                    nCtr = (nCtr + 1)
                Loop
            End Sub

            Public Overridable Function GetEnumerator() As System.Collections.IEnumerator Implements System.Collections.IEnumerable.GetEnumerator
                Return New NetworkAdapterConfigurationEnumerator(privColObj.GetEnumerator)
            End Function

            Public Class NetworkAdapterConfigurationEnumerator
                Inherits Object
                Implements System.Collections.IEnumerator

                Private privObjEnum As ManagementObjectCollection.ManagementObjectEnumerator

                Public Sub New(ByVal objEnum As ManagementObjectCollection.ManagementObjectEnumerator)
                    MyBase.New()
                    privObjEnum = objEnum
                End Sub

                Public Overridable ReadOnly Property Current() As Object Implements System.Collections.IEnumerator.Current
                    Get
                        Return New NetworkAdapterConfiguration(CType(privObjEnum.Current, System.Management.ManagementObject))
                    End Get
                End Property

                Public Overridable Function MoveNext() As Boolean Implements System.Collections.IEnumerator.MoveNext
                    Return privObjEnum.MoveNext
                End Function

                Public Overridable Sub Reset() Implements System.Collections.IEnumerator.Reset
                    privObjEnum.Reset()
                End Sub
            End Class
        End Class

        'TypeConverter to handle null values for ValueType properties
        Public Class WMIValueTypeConverter
            Inherits TypeConverter

            Private baseConverter As TypeConverter

            Private baseType As System.Type

            Public Sub New(ByVal inBaseType As System.Type)
                MyBase.New()
                baseConverter = TypeDescriptor.GetConverter(inBaseType)
                baseType = inBaseType
            End Sub

            Public Overloads Overrides Function CanConvertFrom(ByVal context As System.ComponentModel.ITypeDescriptorContext, ByVal srcType As System.Type) As Boolean
                Return baseConverter.CanConvertFrom(context, srcType)
            End Function

            Public Overloads Overrides Function CanConvertTo(ByVal context As System.ComponentModel.ITypeDescriptorContext, ByVal destinationType As System.Type) As Boolean
                Return baseConverter.CanConvertTo(context, destinationType)
            End Function

            Public Overloads Overrides Function ConvertFrom(ByVal context As System.ComponentModel.ITypeDescriptorContext, ByVal culture As System.Globalization.CultureInfo, ByVal value As Object) As Object
                Return baseConverter.ConvertFrom(context, culture, value)
            End Function

            Public Overloads Overrides Function CreateInstance(ByVal context As System.ComponentModel.ITypeDescriptorContext, ByVal dictionary As System.Collections.IDictionary) As Object
                Return baseConverter.CreateInstance(context, dictionary)
            End Function

            Public Overloads Overrides Function GetCreateInstanceSupported(ByVal context As System.ComponentModel.ITypeDescriptorContext) As Boolean
                Return baseConverter.GetCreateInstanceSupported(context)
            End Function

            Public Overloads Overrides Function GetProperties(ByVal context As System.ComponentModel.ITypeDescriptorContext, ByVal value As Object, ByVal attributeVar() As System.Attribute) As PropertyDescriptorCollection
                Return baseConverter.GetProperties(context, value, attributeVar)
            End Function

            Public Overloads Overrides Function GetPropertiesSupported(ByVal context As System.ComponentModel.ITypeDescriptorContext) As Boolean
                Return baseConverter.GetPropertiesSupported(context)
            End Function

            Public Overloads Overrides Function GetStandardValues(ByVal context As System.ComponentModel.ITypeDescriptorContext) As System.ComponentModel.TypeConverter.StandardValuesCollection
                Return baseConverter.GetStandardValues(context)
            End Function

            Public Overloads Overrides Function GetStandardValuesExclusive(ByVal context As System.ComponentModel.ITypeDescriptorContext) As Boolean
                Return baseConverter.GetStandardValuesExclusive(context)
            End Function

            Public Overloads Overrides Function GetStandardValuesSupported(ByVal context As System.ComponentModel.ITypeDescriptorContext) As Boolean
                Return baseConverter.GetStandardValuesSupported(context)
            End Function

            Public Overloads Overrides Function ConvertTo(ByVal context As System.ComponentModel.ITypeDescriptorContext, ByVal culture As System.Globalization.CultureInfo, ByVal value As Object, ByVal destinationType As System.Type) As Object
                If (baseType.BaseType Is GetType(System.[Enum])) Then
                    If (value.GetType Is destinationType) Then
                        Return value
                    End If
                    If (((value = Nothing) _
                                AndAlso (Not (context) Is Nothing)) _
                                AndAlso (context.PropertyDescriptor.ShouldSerializeValue(context.Instance) = False)) Then
                        Return "NULL_ENUM_VALUE"
                    End If
                    Return baseConverter.ConvertTo(context, culture, value, destinationType)
                End If
                If ((baseType Is GetType(Boolean)) _
                            AndAlso (baseType.BaseType Is GetType(System.ValueType))) Then
                    If (((value = Nothing) _
                                AndAlso (Not (context) Is Nothing)) _
                                AndAlso (context.PropertyDescriptor.ShouldSerializeValue(context.Instance) = False)) Then
                        Return ""
                    End If
                    Return baseConverter.ConvertTo(context, culture, value, destinationType)
                End If
                If ((Not (context) Is Nothing) _
                            AndAlso (context.PropertyDescriptor.ShouldSerializeValue(context.Instance) = False)) Then
                    Return ""
                End If
                Return baseConverter.ConvertTo(context, culture, value, destinationType)
            End Function
        End Class

        'Embedded class to represent WMI system Properties.
        <TypeConverter(GetType(System.ComponentModel.ExpandableObjectConverter))> _
        Public Class ManagementSystemProperties

            Private PrivateLateBoundObject As System.Management.ManagementBaseObject

            Public Sub New(ByVal ManagedObject As System.Management.ManagementBaseObject)
                MyBase.New()
                PrivateLateBoundObject = ManagedObject
            End Sub

            <Browsable(True)> _
            Public ReadOnly Property GENUS() As Integer
                Get
                    Return CType(PrivateLateBoundObject("__GENUS"), Integer)
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property [CLASS]() As String
                Get
                    Return CType(PrivateLateBoundObject("__CLASS"), String)
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property SUPERCLASS() As String
                Get
                    Return CType(PrivateLateBoundObject("__SUPERCLASS"), String)
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property DYNASTY() As String
                Get
                    Return CType(PrivateLateBoundObject("__DYNASTY"), String)
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property RELPATH() As String
                Get
                    Return CType(PrivateLateBoundObject("__RELPATH"), String)
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property PROPERTY_COUNT() As Integer
                Get
                    Return CType(PrivateLateBoundObject("__PROPERTY_COUNT"), Integer)
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property DERIVATION() As String()
                Get
                    Return CType(PrivateLateBoundObject("__DERIVATION"), String())
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property SERVER() As String
                Get
                    Return CType(PrivateLateBoundObject("__SERVER"), String)
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property [NAMESPACE]() As String
                Get
                    Return CType(PrivateLateBoundObject("__NAMESPACE"), String)
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property PATH() As String
                Get
                    Return CType(PrivateLateBoundObject("__PATH"), String)
                End Get
            End Property
        End Class

#End Region


    End Class

    'Functions ShouldSerialize<PropertyName> are functions used by VS property browser to check if a particular property has to be serialized. These functions are added for all ValueType properties ( properties of type Int32, BOOL etc.. which cannot be set to null). These functions use Is<PropertyName>Null function. These functions are also used in the TypeConverter implementation for the properties to check for NULL value of property so that an empty value can be shown in Property browser in case of Drag and Drop in Visual studio.
    'Functions Is<PropertyName>Null() are used to check if a property is NULL.
    'Functions Reset<PropertyName> are added for Nullable Read/Write properties. These functions are used by VS designer in property browser to set a property to NULL.
    'Every property added to the class for WMI property has attributes set to define its behavior in Visual Studio designer and also to define a TypeConverter to be used.
    'Datetime conversion functions ToDateTime and ToDmtfDateTime are added to the class to convert DMTF datetime to System.DateTime and vice-versa.
    'An Early Bound class generated for the WMI class.Win32_NTLogEvent
    Public Class NTLogEvent
        Inherits System.ComponentModel.Component

        'Private property to hold the WMI namespace in which the class resides.
        Private Shared CreatedWmiNamespace As String = "root\cimv2"

        'Private property to hold the name of WMI class which created this class.
        Private Shared CreatedClassName As String = "Win32_NTLogEvent"

        'Private member variable to hold the ManagementScope which is used by the various methods.
        Private Shared statMgmtScope As System.Management.ManagementScope = Nothing

        Private PrivateSystemProperties As ManagementSystemProperties

        'Underlying lateBound WMI object.
        Private PrivateLateBoundObject As System.Management.ManagementObject

        'Member variable to store the 'automatic commit' behavior for the class.
        Private AutoCommitProp As Boolean

        'Private variable to hold the embedded property representing the instance.
        Private embeddedObj As System.Management.ManagementBaseObject

        'The current WMI object used
        Private curObj As System.Management.ManagementBaseObject

        'Flag to indicate if the instance is an embedded object.
        Private isEmbedded As Boolean

        'Below are different overloads of constructors to initialize an instance of the class with a WMI object.
        Public Sub New()
            MyBase.New()
            Me.InitializeObject(Nothing, Nothing, Nothing)
        End Sub

        Public Sub New(ByVal keyLogfile As String, ByVal keyRecordNumber As UInteger)
            MyBase.New()
            Me.InitializeObject(Nothing, New System.Management.ManagementPath(NTLogEvent.ConstructPath(keyLogfile, keyRecordNumber)), Nothing)
        End Sub

        Public Sub New(ByVal mgmtScope As System.Management.ManagementScope, ByVal keyLogfile As String, ByVal keyRecordNumber As UInteger)
            MyBase.New()
            Me.InitializeObject(CType(mgmtScope, System.Management.ManagementScope), New System.Management.ManagementPath(NTLogEvent.ConstructPath(keyLogfile, keyRecordNumber)), Nothing)
        End Sub

        Public Sub New(ByVal path As System.Management.ManagementPath, ByVal getOptions As System.Management.ObjectGetOptions)
            MyBase.New()
            Me.InitializeObject(Nothing, path, getOptions)
        End Sub

        Public Sub New(ByVal mgmtScope As System.Management.ManagementScope, ByVal path As System.Management.ManagementPath)
            MyBase.New()
            Me.InitializeObject(mgmtScope, path, Nothing)
        End Sub

        Public Sub New(ByVal path As System.Management.ManagementPath)
            MyBase.New()
            Me.InitializeObject(Nothing, path, Nothing)
        End Sub

        Public Sub New(ByVal mgmtScope As System.Management.ManagementScope, ByVal path As System.Management.ManagementPath, ByVal getOptions As System.Management.ObjectGetOptions)
            MyBase.New()
            Me.InitializeObject(mgmtScope, path, getOptions)
        End Sub

        Public Sub New(ByVal theObject As System.Management.ManagementObject)
            MyBase.New()
            Initialize()
            If (CheckIfProperClass(theObject) = True) Then
                PrivateLateBoundObject = theObject
                PrivateSystemProperties = New ManagementSystemProperties(PrivateLateBoundObject)
                curObj = PrivateLateBoundObject
            Else
                Throw New System.ArgumentException("Class name does not match.")
            End If
        End Sub

        Public Sub New(ByVal theObject As System.Management.ManagementBaseObject)
            MyBase.New()
            Initialize()
            If (CheckIfProperClass(theObject) = True) Then
                embeddedObj = theObject
                PrivateSystemProperties = New ManagementSystemProperties(theObject)
                curObj = embeddedObj
                isEmbedded = True
            Else
                Throw New System.ArgumentException("Class name does not match.")
            End If
        End Sub

        'Property returns the namespace of the WMI class.
        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property OriginatingNamespace() As String
            Get
                Return "root\cimv2"
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property ManagementClassName() As String
            Get
                Dim strRet As String = CreatedClassName
                If (Not (curObj) Is Nothing) Then
                    If (Not (curObj.ClassPath) Is Nothing) Then
                        strRet = CType(curObj("__CLASS"), String)
                        If ((strRet Is Nothing) _
                                    OrElse (strRet Is String.Empty)) Then
                            strRet = CreatedClassName
                        End If
                    End If
                End If
                Return strRet
            End Get
        End Property

        'Property pointing to an embedded object to get System properties of the WMI object.
        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property SystemProperties() As ManagementSystemProperties
            Get
                Return PrivateSystemProperties
            End Get
        End Property

        'Property returning the underlying lateBound object.
        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property LateBoundObject() As System.Management.ManagementBaseObject
            Get
                Return curObj
            End Get
        End Property

        'ManagementScope of the object.
        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public Property Scope() As System.Management.ManagementScope
            Get
                If (isEmbedded = False) Then
                    Return PrivateLateBoundObject.Scope
                Else
                    Return Nothing
                End If
            End Get
            Set(ByVal value As System.Management.ManagementScope)
                If (isEmbedded = False) Then
                    PrivateLateBoundObject.Scope = value
                End If
            End Set
        End Property

        'Property to show the commit behavior for the WMI object. If true, WMI object will be automatically saved after each property modification.(ie. Put() is called after modification of a property).
        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public Property AutoCommit() As Boolean
            Get
                Return AutoCommitProp
            End Get
            Set(ByVal value As Boolean)
                AutoCommitProp = value
            End Set
        End Property

        'The ManagementPath of the underlying WMI object.
        <Browsable(True)> _
        Public Property Path() As System.Management.ManagementPath
            Get
                If (isEmbedded = False) Then
                    Return PrivateLateBoundObject.Path
                Else
                    Return Nothing
                End If
            End Get
            Set(ByVal value As System.Management.ManagementPath)
                If (isEmbedded = False) Then
                    If (CheckIfProperClass(Nothing, value, Nothing) <> True) Then
                        Throw New System.ArgumentException("Class name does not match.")
                    End If
                    PrivateLateBoundObject.Path = value
                End If
            End Set
        End Property

        'Public static scope property which is used by the various methods.
        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public Shared Property StaticScope() As System.Management.ManagementScope
            Get
                Return statMgmtScope
            End Get
            Set(ByVal value As System.Management.ManagementScope)
                statMgmtScope = value
            End Set
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsCategoryNull() As Boolean
            Get
                If (curObj("Category") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("Specifies a subcategory for this event. This subcategory is source specific."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property Category() As UShort
            Get
                If (curObj("Category") Is Nothing) Then
                    Return System.Convert.ToUInt16(0)
                End If
                Return CType(curObj("Category"), UShort)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("Specifies the translation of the subcategory. The translation is source specific." & _
            "")> _
        Public ReadOnly Property CategoryString() As String
            Get
                Return CType(curObj("CategoryString"), String)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The variable-length null-terminated string specifying the name of the computer th" & _
            "at generated this event.")> _
        Public ReadOnly Property ComputerName() As String
            Get
                Return CType(curObj("ComputerName"), String)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The binary data that accompanied the report of the NT event.")> _
        Public ReadOnly Property Data() As Byte()
            Get
                Return CType(curObj("Data"), Byte())
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsEventCodeNull() As Boolean
            Get
                If (curObj("EventCode") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("This property has the value of the lower 16-bits of the EventIdentifier property." & _
            " It is present to match the value displayed in the NT Event Viewer. NOTE: Two ev" & _
            "ents from the same source may have the same value for this property but may have" & _
            " different severity and EventIdentifier values"), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property EventCode() As UShort
            Get
                If (curObj("EventCode") Is Nothing) Then
                    Return System.Convert.ToUInt16(0)
                End If
                Return CType(curObj("EventCode"), UShort)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsEventIdentifierNull() As Boolean
            Get
                If (curObj("EventIdentifier") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("Identifies the event. This is specific to the source that generated the event log" & _
            " entry, and is used, together with SourceName, to uniquely identify an NT event " & _
            "type."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property EventIdentifier() As UInteger
            Get
                If (curObj("EventIdentifier") Is Nothing) Then
                    Return System.Convert.ToUInt32(0)
                End If
                Return CType(curObj("EventIdentifier"), UInteger)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsEventTypeNull() As Boolean
            Get
                If (curObj("EventType") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The Type property specifies the type of event."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property EventType() As EventTypeValues
            Get
                If (curObj("EventType") Is Nothing) Then
                    Return CType(System.Convert.ToInt32(6), EventTypeValues)
                End If
                Return CType(System.Convert.ToInt32(curObj("EventType")), EventTypeValues)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The insertion strings that accompanied the report of the NT event.")> _
        Public ReadOnly Property InsertionStrings() As String()
            Get
                Return CType(curObj("InsertionStrings"), String())
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The name of NT Eventlog logfile. This is used together with the RecordNumber to u" & _
            "niquely identify an instance of this class.")> _
        Public ReadOnly Property Logfile() As String
            Get
                Return CType(curObj("Logfile"), String)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The event message as it appears in the NT Eventlog. This is a standard message wi" & _
            "th zero or more insertion strings supplied by the source of the NT event. The in" & _
            "sertion strings are inserted into the standard message in a predefined format. I" & _
            "f there are no insertion strings or there is a problem inserting the insertion s" & _
            "trings, only the standard message will be present in this field.")> _
        Public ReadOnly Property Message() As String
            Get
                Return CType(curObj("Message"), String)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsRecordNumberNull() As Boolean
            Get
                If (curObj("RecordNumber") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("Identifies the event within the NT Eventlog logfile. This is specific to the logf" & _
            "ile and is used together with the logfile name to uniquely identify an instance " & _
            "of this class."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property RecordNumber() As UInteger
            Get
                If (curObj("RecordNumber") Is Nothing) Then
                    Return System.Convert.ToUInt32(0)
                End If
                Return CType(curObj("RecordNumber"), UInteger)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The variable-length null-terminated string specifying the name of the source (app" & _
            "lication, service, driver, subsystem) that generated the entry. It is used, toge" & _
            "ther with the EventIdentifier, to uniquely identify an NT event type.")> _
        Public ReadOnly Property SourceName() As String
            Get
                Return CType(curObj("SourceName"), String)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsTimeGeneratedNull() As Boolean
            Get
                If (curObj("TimeGenerated") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("Specifies the time at which the source generated the event."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property TimeGenerated() As Date
            Get
                If (Not (curObj("TimeGenerated")) Is Nothing) Then
                    Return ToDateTime(CType(curObj("TimeGenerated"), String))
                Else
                    Return Date.MinValue
                End If
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsTimeWrittenNull() As Boolean
            Get
                If (curObj("TimeWritten") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("Specifies the time at which the event was written to the logfile."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property TimeWritten() As Date
            Get
                If (Not (curObj("TimeWritten")) Is Nothing) Then
                    Return ToDateTime(CType(curObj("TimeWritten"), String))
                Else
                    Return Date.MinValue
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("Specifies the type of event. This is an enumerated string")> _
        Public ReadOnly Property Type() As String
            Get
                Return CType(curObj("Type"), String)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The user name of the logged on user when the event ocurred. If the user name cann" & _
            "ot be determined this will be NULL")> _
        Public ReadOnly Property User() As String
            Get
                Return CType(curObj("User"), String)
            End Get
        End Property

        Private Overloads Function CheckIfProperClass(ByVal mgmtScope As System.Management.ManagementScope, ByVal path As System.Management.ManagementPath, ByVal OptionsParam As System.Management.ObjectGetOptions) As Boolean
            If ((Not (path) Is Nothing) _
                        AndAlso (String.Compare(path.ClassName, Me.ManagementClassName, True, System.Globalization.CultureInfo.InvariantCulture) = 0)) Then
                Return True
            Else
                Return CheckIfProperClass(New System.Management.ManagementObject(mgmtScope, path, OptionsParam))
            End If
        End Function

        Private Overloads Function CheckIfProperClass(ByVal theObj As System.Management.ManagementBaseObject) As Boolean
            If ((Not (theObj) Is Nothing) _
                        AndAlso (String.Compare(CType(theObj("__CLASS"), String), Me.ManagementClassName, True, System.Globalization.CultureInfo.InvariantCulture) = 0)) Then
                Return True
            Else
                Dim parentClasses As System.Array = CType(theObj("__DERIVATION"), System.Array)
                If (Not (parentClasses) Is Nothing) Then
                    Dim count As Integer = 0
                    count = 0
                    Do While (count < parentClasses.Length)
                        If (String.Compare(CType(parentClasses.GetValue(count), String), Me.ManagementClassName, True, System.Globalization.CultureInfo.InvariantCulture) = 0) Then
                            Return True
                        End If
                        count = (count + 1)
                    Loop
                End If
            End If
            Return False
        End Function

        Private Function ShouldSerializeCategory() As Boolean
            If (Me.IsCategoryNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeEventCode() As Boolean
            If (Me.IsEventCodeNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeEventIdentifier() As Boolean
            If (Me.IsEventIdentifierNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeEventType() As Boolean
            If (Me.IsEventTypeNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeRecordNumber() As Boolean
            If (Me.IsRecordNumberNull = False) Then
                Return True
            End If
            Return False
        End Function

        'Converts a given datetime in DMTF format to System.DateTime object.
        Shared Function ToDateTime(ByVal dmtfDate As String) As Date
            Dim initializer As Date = Date.MinValue
            Dim year As Integer = initializer.Year
            Dim month As Integer = initializer.Month
            Dim day As Integer = initializer.Day
            Dim hour As Integer = initializer.Hour
            Dim minute As Integer = initializer.Minute
            Dim second As Integer = initializer.Second
            Dim ticks As Long = 0
            Dim dmtf As String = dmtfDate
            Dim datetime As Date = Date.MinValue
            Dim tempString As String = String.Empty
            If (dmtf Is Nothing) Then
                Throw New System.ArgumentOutOfRangeException
            End If
            If (dmtf.Length = 0) Then
                Throw New System.ArgumentOutOfRangeException
            End If
            If (dmtf.Length <> 25) Then
                Throw New System.ArgumentOutOfRangeException
            End If
            Try
                tempString = dmtf.Substring(0, 4)
                If ("****" <> tempString) Then
                    year = Integer.Parse(tempString)
                End If
                tempString = dmtf.Substring(4, 2)
                If ("**" <> tempString) Then
                    month = Integer.Parse(tempString)
                End If
                tempString = dmtf.Substring(6, 2)
                If ("**" <> tempString) Then
                    day = Integer.Parse(tempString)
                End If
                tempString = dmtf.Substring(8, 2)
                If ("**" <> tempString) Then
                    hour = Integer.Parse(tempString)
                End If
                tempString = dmtf.Substring(10, 2)
                If ("**" <> tempString) Then
                    minute = Integer.Parse(tempString)
                End If
                tempString = dmtf.Substring(12, 2)
                If ("**" <> tempString) Then
                    second = Integer.Parse(tempString)
                End If
                tempString = dmtf.Substring(15, 6)
                If ("******" <> tempString) Then
                    ticks = (Long.Parse(tempString) * CType((System.TimeSpan.TicksPerMillisecond / 1000), Long))
                End If
                If ((((((((year < 0) _
                            OrElse (month < 0)) _
                            OrElse (day < 0)) _
                            OrElse (hour < 0)) _
                            OrElse (minute < 0)) _
                            OrElse (minute < 0)) _
                            OrElse (second < 0)) _
                            OrElse (ticks < 0)) Then
                    Throw New System.ArgumentOutOfRangeException
                End If
            Catch e As System.Exception
                Throw New System.ArgumentOutOfRangeException(Nothing, e.Message)
            End Try
            datetime = New Date(year, month, day, hour, minute, second, 0)
            datetime = datetime.AddTicks(ticks)
            Dim tickOffset As System.TimeSpan = System.TimeZone.CurrentTimeZone.GetUtcOffset(datetime)
            Dim UTCOffset As Integer = 0
            Dim OffsetToBeAdjusted As Integer = 0
            Dim OffsetMins As Long = CType((tickOffset.Ticks / System.TimeSpan.TicksPerMinute), Long)
            tempString = dmtf.Substring(22, 3)
            If (tempString <> "******") Then
                tempString = dmtf.Substring(21, 4)
                Try
                    UTCOffset = Integer.Parse(tempString)
                Catch e As System.Exception
                    Throw New System.ArgumentOutOfRangeException(Nothing, e.Message)
                End Try
                OffsetToBeAdjusted = CType((OffsetMins - UTCOffset), Integer)
                datetime = datetime.AddMinutes(CType(OffsetToBeAdjusted, Double))
            End If
            Return datetime
        End Function

        'Converts a given System.DateTime object to DMTF datetime format.
        Shared Function ToDmtfDateTime(ByVal [date] As Date) As String
            Dim utcString As String = String.Empty
            Dim tickOffset As System.TimeSpan = System.TimeZone.CurrentTimeZone.GetUtcOffset([date])
            Dim OffsetMins As Long = CType((tickOffset.Ticks / System.TimeSpan.TicksPerMinute), Long)
            If (System.Math.Abs(OffsetMins) > 999) Then
                [date] = [date].ToUniversalTime
                utcString = "+000"
            Else
                If (tickOffset.Ticks >= 0) Then
                    utcString = String.Concat("+", CType((tickOffset.Ticks / System.TimeSpan.TicksPerMinute), System.Int64).ToString.PadLeft(3, Global.Microsoft.VisualBasic.ChrW(48)))
                Else
                    Dim strTemp As String = CType(OffsetMins, System.Int64).ToString
                    utcString = String.Concat("-", strTemp.Substring(1, (strTemp.Length - 1)).PadLeft(3, Global.Microsoft.VisualBasic.ChrW(48)))
                End If
            End If
            Dim dmtfDateTime As String = CType([date].Year, System.Int32).ToString.PadLeft(4, Global.Microsoft.VisualBasic.ChrW(48))
            dmtfDateTime = String.Concat(dmtfDateTime, CType([date].Month, System.Int32).ToString.PadLeft(2, Global.Microsoft.VisualBasic.ChrW(48)))
            dmtfDateTime = String.Concat(dmtfDateTime, CType([date].Day, System.Int32).ToString.PadLeft(2, Global.Microsoft.VisualBasic.ChrW(48)))
            dmtfDateTime = String.Concat(dmtfDateTime, CType([date].Hour, System.Int32).ToString.PadLeft(2, Global.Microsoft.VisualBasic.ChrW(48)))
            dmtfDateTime = String.Concat(dmtfDateTime, CType([date].Minute, System.Int32).ToString.PadLeft(2, Global.Microsoft.VisualBasic.ChrW(48)))
            dmtfDateTime = String.Concat(dmtfDateTime, CType([date].Second, System.Int32).ToString.PadLeft(2, Global.Microsoft.VisualBasic.ChrW(48)))
            dmtfDateTime = String.Concat(dmtfDateTime, ".")
            Dim dtTemp As Date = New Date([date].Year, [date].Month, [date].Day, [date].Hour, [date].Minute, [date].Second, 0)
            Dim microsec As Long = CType(((([date].Ticks - dtTemp.Ticks) _
                        * 1000) _
                        / System.TimeSpan.TicksPerMillisecond), Long)
            Dim strMicrosec As String = CType(microsec, System.Int64).ToString
            If (strMicrosec.Length > 6) Then
                strMicrosec = strMicrosec.Substring(0, 6)
            End If
            dmtfDateTime = String.Concat(dmtfDateTime, strMicrosec.PadLeft(6, Global.Microsoft.VisualBasic.ChrW(48)))
            dmtfDateTime = String.Concat(dmtfDateTime, utcString)
            Return dmtfDateTime
        End Function

        Private Function ShouldSerializeTimeGenerated() As Boolean
            If (Me.IsTimeGeneratedNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeTimeWritten() As Boolean
            If (Me.IsTimeWrittenNull = False) Then
                Return True
            End If
            Return False
        End Function

        <Browsable(True)> _
        Public Overloads Sub CommitObject()
            If (isEmbedded = False) Then
                PrivateLateBoundObject.Put()
            End If
        End Sub

        <Browsable(True)> _
        Public Overloads Sub CommitObject(ByVal putOptions As System.Management.PutOptions)
            If (isEmbedded = False) Then
                PrivateLateBoundObject.Put(putOptions)
            End If
        End Sub

        Private Sub Initialize()
            AutoCommitProp = True
            isEmbedded = False
        End Sub

        Private Shared Function ConstructPath(ByVal keyLogfile As String, ByVal keyRecordNumber As UInteger) As String
            Dim strPath As String = "root\cimv2:Win32_NTLogEvent"
            strPath = String.Concat(strPath, String.Concat(".Logfile=", String.Concat("""", String.Concat(keyLogfile, """"))))
            strPath = String.Concat(strPath, String.Concat(",RecordNumber=", CType(keyRecordNumber, System.UInt32).ToString))
            Return strPath
        End Function

        Private Sub InitializeObject(ByVal mgmtScope As System.Management.ManagementScope, ByVal path As System.Management.ManagementPath, ByVal getOptions As System.Management.ObjectGetOptions)
            Initialize()
            If (Not (path) Is Nothing) Then
                If (CheckIfProperClass(mgmtScope, path, getOptions) <> True) Then
                    Throw New System.ArgumentException("Class name does not match.")
                End If
            End If
            PrivateLateBoundObject = New System.Management.ManagementObject(mgmtScope, path, getOptions)
            PrivateSystemProperties = New ManagementSystemProperties(PrivateLateBoundObject)
            curObj = PrivateLateBoundObject
        End Sub

        'Different overloads of GetInstances() help in enumerating instances of the WMI class.
        Public Overloads Shared Function GetInstances() As NTLogEventCollection
            Return GetInstances(Nothing, Nothing, Nothing)
        End Function

        Public Overloads Shared Function GetInstances(ByVal condition As String) As NTLogEventCollection
            Return GetInstances(Nothing, condition, Nothing)
        End Function

        Public Overloads Shared Function GetInstances(ByVal selectedProperties() As System.String) As NTLogEventCollection
            Return GetInstances(Nothing, Nothing, selectedProperties)
        End Function

        Public Overloads Shared Function GetInstances(ByVal condition As String, ByVal selectedProperties() As System.String) As NTLogEventCollection
            Return GetInstances(Nothing, condition, selectedProperties)
        End Function

        Public Overloads Shared Function GetInstances(ByVal mgmtScope As System.Management.ManagementScope, ByVal enumOptions As System.Management.EnumerationOptions) As NTLogEventCollection
            If (mgmtScope Is Nothing) Then
                If (statMgmtScope Is Nothing) Then
                    mgmtScope = New System.Management.ManagementScope
                    mgmtScope.Path.NamespacePath = "root\cimv2"
                Else
                    mgmtScope = statMgmtScope
                End If
            End If
            Dim pathObj As System.Management.ManagementPath = New System.Management.ManagementPath
            pathObj.ClassName = "Win32_NTLogEvent"
            pathObj.NamespacePath = "root\cimv2"
            Dim clsObject As System.Management.ManagementClass = New System.Management.ManagementClass(mgmtScope, pathObj, Nothing)
            If (enumOptions Is Nothing) Then
                enumOptions = New System.Management.EnumerationOptions
                enumOptions.EnsureLocatable = True
            End If
            Return New NTLogEventCollection(clsObject.GetInstances(enumOptions))
        End Function

        Public Overloads Shared Function GetInstances(ByVal mgmtScope As System.Management.ManagementScope, ByVal condition As String) As NTLogEventCollection
            Return GetInstances(mgmtScope, condition, Nothing)
        End Function

        Public Overloads Shared Function GetInstances(ByVal mgmtScope As System.Management.ManagementScope, ByVal selectedProperties() As System.String) As NTLogEventCollection
            Return GetInstances(mgmtScope, Nothing, selectedProperties)
        End Function

        Public Overloads Shared Function GetInstances(ByVal mgmtScope As System.Management.ManagementScope, ByVal condition As String, ByVal selectedProperties() As System.String) As NTLogEventCollection
            If (mgmtScope Is Nothing) Then
                If (statMgmtScope Is Nothing) Then
                    mgmtScope = New System.Management.ManagementScope
                    mgmtScope.Path.NamespacePath = "root\cimv2"
                Else
                    mgmtScope = statMgmtScope
                End If
            End If
            Dim ObjectSearcher As System.Management.ManagementObjectSearcher = New System.Management.ManagementObjectSearcher(mgmtScope, New SelectQuery("Win32_NTLogEvent", condition, selectedProperties))
            Dim enumOptions As System.Management.EnumerationOptions = New System.Management.EnumerationOptions
            enumOptions.EnsureLocatable = True
            ObjectSearcher.Options = enumOptions
            Return New NTLogEventCollection(ObjectSearcher.Get)
        End Function

        <Browsable(True)> _
        Public Shared Function CreateInstance() As NTLogEvent
            Dim mgmtScope As System.Management.ManagementScope = Nothing
            If (statMgmtScope Is Nothing) Then
                mgmtScope = New System.Management.ManagementScope
                mgmtScope.Path.NamespacePath = CreatedWmiNamespace
            Else
                mgmtScope = statMgmtScope
            End If
            Dim mgmtPath As System.Management.ManagementPath = New System.Management.ManagementPath(CreatedClassName)
            Dim tmpMgmtClass As System.Management.ManagementClass = New System.Management.ManagementClass(mgmtScope, mgmtPath, Nothing)
            Return New NTLogEvent(tmpMgmtClass.CreateInstance)
        End Function

        <Browsable(True)> _
        Public Sub Delete()
            PrivateLateBoundObject.Delete()
        End Sub

        Public Enum EventTypeValues

            Success = 0

            [Error] = 1

            Warning = 2

            Information = 3

            Security_Audit_Success = 4

            Security_Audit_Failure = 5

            NULL_ENUM_VALUE = 6
        End Enum

        'Enumerator implementation for enumerating instances of the class.
        Public Class NTLogEventCollection
            Inherits Object
            Implements ICollection

            Private privColObj As ManagementObjectCollection

            Public Sub New(ByVal objCollection As ManagementObjectCollection)
                MyBase.New()
                privColObj = objCollection
            End Sub

            Public Overridable ReadOnly Property Count() As Integer Implements System.Collections.ICollection.Count
                Get
                    Return privColObj.Count
                End Get
            End Property

            Public Overridable ReadOnly Property IsSynchronized() As Boolean Implements System.Collections.ICollection.IsSynchronized
                Get
                    Return privColObj.IsSynchronized
                End Get
            End Property

            Public Overridable ReadOnly Property SyncRoot() As Object Implements System.Collections.ICollection.SyncRoot
                Get
                    Return Me
                End Get
            End Property

            Public Overridable Sub CopyTo(ByVal array As System.Array, ByVal index As Integer) Implements System.Collections.ICollection.CopyTo
                privColObj.CopyTo(array, index)
                Dim nCtr As Integer
                nCtr = 0
                Do While (nCtr < array.Length)
                    array.SetValue(New NTLogEvent(CType(array.GetValue(nCtr), System.Management.ManagementObject)), nCtr)
                    nCtr = (nCtr + 1)
                Loop
            End Sub

            Public Overridable Function GetEnumerator() As System.Collections.IEnumerator Implements System.Collections.IEnumerable.GetEnumerator
                Return New NTLogEventEnumerator(privColObj.GetEnumerator)
            End Function

            Public Class NTLogEventEnumerator
                Inherits Object
                Implements System.Collections.IEnumerator

                Private privObjEnum As ManagementObjectCollection.ManagementObjectEnumerator

                Public Sub New(ByVal objEnum As ManagementObjectCollection.ManagementObjectEnumerator)
                    MyBase.New()
                    privObjEnum = objEnum
                End Sub

                Public Overridable ReadOnly Property Current() As Object Implements System.Collections.IEnumerator.Current
                    Get
                        Return New NTLogEvent(CType(privObjEnum.Current, System.Management.ManagementObject))
                    End Get
                End Property

                Public Overridable Function MoveNext() As Boolean Implements System.Collections.IEnumerator.MoveNext
                    Return privObjEnum.MoveNext
                End Function

                Public Overridable Sub Reset() Implements System.Collections.IEnumerator.Reset
                    privObjEnum.Reset()
                End Sub
            End Class
        End Class

        'TypeConverter to handle null values for ValueType properties
        Public Class WMIValueTypeConverter
            Inherits TypeConverter

            Private baseConverter As TypeConverter

            Private baseType As System.Type

            Public Sub New(ByVal inBaseType As System.Type)
                MyBase.New()
                baseConverter = TypeDescriptor.GetConverter(inBaseType)
                baseType = inBaseType
            End Sub

            Public Overloads Overrides Function CanConvertFrom(ByVal context As System.ComponentModel.ITypeDescriptorContext, ByVal srcType As System.Type) As Boolean
                Return baseConverter.CanConvertFrom(context, srcType)
            End Function

            Public Overloads Overrides Function CanConvertTo(ByVal context As System.ComponentModel.ITypeDescriptorContext, ByVal destinationType As System.Type) As Boolean
                Return baseConverter.CanConvertTo(context, destinationType)
            End Function

            Public Overloads Overrides Function ConvertFrom(ByVal context As System.ComponentModel.ITypeDescriptorContext, ByVal culture As System.Globalization.CultureInfo, ByVal value As Object) As Object
                Return baseConverter.ConvertFrom(context, culture, value)
            End Function

            Public Overloads Overrides Function CreateInstance(ByVal context As System.ComponentModel.ITypeDescriptorContext, ByVal dictionary As System.Collections.IDictionary) As Object
                Return baseConverter.CreateInstance(context, dictionary)
            End Function

            Public Overloads Overrides Function GetCreateInstanceSupported(ByVal context As System.ComponentModel.ITypeDescriptorContext) As Boolean
                Return baseConverter.GetCreateInstanceSupported(context)
            End Function

            Public Overloads Overrides Function GetProperties(ByVal context As System.ComponentModel.ITypeDescriptorContext, ByVal value As Object, ByVal attributeVar() As System.Attribute) As PropertyDescriptorCollection
                Return baseConverter.GetProperties(context, value, attributeVar)
            End Function

            Public Overloads Overrides Function GetPropertiesSupported(ByVal context As System.ComponentModel.ITypeDescriptorContext) As Boolean
                Return baseConverter.GetPropertiesSupported(context)
            End Function

            Public Overloads Overrides Function GetStandardValues(ByVal context As System.ComponentModel.ITypeDescriptorContext) As System.ComponentModel.TypeConverter.StandardValuesCollection
                Return baseConverter.GetStandardValues(context)
            End Function

            Public Overloads Overrides Function GetStandardValuesExclusive(ByVal context As System.ComponentModel.ITypeDescriptorContext) As Boolean
                Return baseConverter.GetStandardValuesExclusive(context)
            End Function

            Public Overloads Overrides Function GetStandardValuesSupported(ByVal context As System.ComponentModel.ITypeDescriptorContext) As Boolean
                Return baseConverter.GetStandardValuesSupported(context)
            End Function

            Public Overloads Overrides Function ConvertTo(ByVal context As System.ComponentModel.ITypeDescriptorContext, ByVal culture As System.Globalization.CultureInfo, ByVal value As Object, ByVal destinationType As System.Type) As Object
                If (baseType.BaseType Is GetType(System.[Enum])) Then
                    If (value.GetType Is destinationType) Then
                        Return value
                    End If
                    If (((value = Nothing) _
                                AndAlso (Not (context) Is Nothing)) _
                                AndAlso (context.PropertyDescriptor.ShouldSerializeValue(context.Instance) = False)) Then
                        Return "NULL_ENUM_VALUE"
                    End If
                    Return baseConverter.ConvertTo(context, culture, value, destinationType)
                End If
                If ((baseType Is GetType(Boolean)) _
                            AndAlso (baseType.BaseType Is GetType(System.ValueType))) Then
                    If (((value = Nothing) _
                                AndAlso (Not (context) Is Nothing)) _
                                AndAlso (context.PropertyDescriptor.ShouldSerializeValue(context.Instance) = False)) Then
                        Return ""
                    End If
                    Return baseConverter.ConvertTo(context, culture, value, destinationType)
                End If
                If ((Not (context) Is Nothing) _
                            AndAlso (context.PropertyDescriptor.ShouldSerializeValue(context.Instance) = False)) Then
                    Return ""
                End If
                Return baseConverter.ConvertTo(context, culture, value, destinationType)
            End Function
        End Class

        'Embedded class to represent WMI system Properties.
        <TypeConverter(GetType(System.ComponentModel.ExpandableObjectConverter))> _
        Public Class ManagementSystemProperties

            Private PrivateLateBoundObject As System.Management.ManagementBaseObject

            Public Sub New(ByVal ManagedObject As System.Management.ManagementBaseObject)
                MyBase.New()
                PrivateLateBoundObject = ManagedObject
            End Sub

            <Browsable(True)> _
            Public ReadOnly Property GENUS() As Integer
                Get
                    Return CType(PrivateLateBoundObject("__GENUS"), Integer)
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property [CLASS]() As String
                Get
                    Return CType(PrivateLateBoundObject("__CLASS"), String)
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property SUPERCLASS() As String
                Get
                    Return CType(PrivateLateBoundObject("__SUPERCLASS"), String)
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property DYNASTY() As String
                Get
                    Return CType(PrivateLateBoundObject("__DYNASTY"), String)
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property RELPATH() As String
                Get
                    Return CType(PrivateLateBoundObject("__RELPATH"), String)
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property PROPERTY_COUNT() As Integer
                Get
                    Return CType(PrivateLateBoundObject("__PROPERTY_COUNT"), Integer)
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property DERIVATION() As String()
                Get
                    Return CType(PrivateLateBoundObject("__DERIVATION"), String())
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property SERVER() As String
                Get
                    Return CType(PrivateLateBoundObject("__SERVER"), String)
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property [NAMESPACE]() As String
                Get
                    Return CType(PrivateLateBoundObject("__NAMESPACE"), String)
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property PATH() As String
                Get
                    Return CType(PrivateLateBoundObject("__PATH"), String)
                End Get
            End Property
        End Class
    End Class

    'Functions ShouldSerialize<PropertyName> are functions used by VS property browser to check if a particular property has to be serialized. These functions are added for all ValueType properties ( properties of type Int32, BOOL etc.. which cannot be set to null). These functions use Is<PropertyName>Null function. These functions are also used in the TypeConverter implementation for the properties to check for NULL value of property so that an empty value can be shown in Property browser in case of Drag and Drop in Visual studio.
    'Functions Is<PropertyName>Null() are used to check if a property is NULL.
    'Functions Reset<PropertyName> are added for Nullable Read/Write properties. These functions are used by VS designer in property browser to set a property to NULL.
    'Every property added to the class for WMI property has attributes set to define its behavior in Visual Studio designer and also to define a TypeConverter to be used.
    'Datetime conversion functions ToDateTime and ToDmtfDateTime are added to the class to convert DMTF datetime to System.DateTime and vice-versa.
    'An Early Bound class generated for the WMI class.Win32_OperatingSystem
    Public Class OperatingSystem0
        Inherits System.ComponentModel.Component

        'Private property to hold the WMI namespace in which the class resides.
        Private Shared CreatedWmiNamespace As String = "root\cimv2"

        'Private property to hold the name of WMI class which created this class.
        Private Shared CreatedClassName As String = "Win32_OperatingSystem"

        'Private member variable to hold the ManagementScope which is used by the various methods.
        Private Shared statMgmtScope As System.Management.ManagementScope = Nothing

        Private PrivateSystemProperties As ManagementSystemProperties

        'Underlying lateBound WMI object.
        Private PrivateLateBoundObject As System.Management.ManagementObject

        'Member variable to store the 'automatic commit' behavior for the class.
        Private AutoCommitProp As Boolean

        'Private variable to hold the embedded property representing the instance.
        Private embeddedObj As System.Management.ManagementBaseObject

        'The current WMI object used
        Private curObj As System.Management.ManagementBaseObject

        'Flag to indicate if the instance is an embedded object.
        Private isEmbedded As Boolean

        'Below are different overloads of constructors to initialize an instance of the class with a WMI object.
        Public Sub New()
            MyBase.New()
            Me.InitializeObject(Nothing, New System.Management.ManagementPath(OperatingSystem0.ConstructPath), Nothing)
        End Sub

        Public Sub New(ByVal mgmtScope As System.Management.ManagementScope)
            MyBase.New()
            Me.InitializeObject(mgmtScope, New System.Management.ManagementPath(OperatingSystem0.ConstructPath), Nothing)
        End Sub

        Public Sub New(ByVal getOptions As System.Management.ObjectGetOptions)
            MyBase.New()
            Me.InitializeObject(Nothing, New System.Management.ManagementPath(OperatingSystem0.ConstructPath), getOptions)
        End Sub

        Public Sub New(ByVal mgmtScope As System.Management.ManagementScope, ByVal getOptions As System.Management.ObjectGetOptions)
            MyBase.New()
            Me.InitializeObject(mgmtScope, New System.Management.ManagementPath(OperatingSystem0.ConstructPath), getOptions)
        End Sub

        Public Sub New(ByVal path As System.Management.ManagementPath)
            MyBase.New()
            Me.InitializeObject(Nothing, path, Nothing)
        End Sub

        Public Sub New(ByVal mgmtScope As System.Management.ManagementScope, ByVal path As System.Management.ManagementPath, ByVal getOptions As System.Management.ObjectGetOptions)
            MyBase.New()
            Me.InitializeObject(mgmtScope, path, getOptions)
        End Sub

        Public Sub New(ByVal theObject As System.Management.ManagementObject)
            MyBase.New()
            Initialize()
            If (CheckIfProperClass(theObject) = True) Then
                PrivateLateBoundObject = theObject
                PrivateSystemProperties = New ManagementSystemProperties(PrivateLateBoundObject)
                curObj = PrivateLateBoundObject
            Else
                Throw New System.ArgumentException("Class name does not match.")
            End If
        End Sub

        Public Sub New(ByVal theObject As System.Management.ManagementBaseObject)
            MyBase.New()
            Initialize()
            If (CheckIfProperClass(theObject) = True) Then
                embeddedObj = theObject
                PrivateSystemProperties = New ManagementSystemProperties(theObject)
                curObj = embeddedObj
                isEmbedded = True
            Else
                Throw New System.ArgumentException("Class name does not match.")
            End If
        End Sub

        'Property returns the namespace of the WMI class.
        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property OriginatingNamespace() As String
            Get
                Return "root\cimv2"
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property ManagementClassName() As String
            Get
                Dim strRet As String = CreatedClassName
                If (Not (curObj) Is Nothing) Then
                    If (Not (curObj.ClassPath) Is Nothing) Then
                        strRet = CType(curObj("__CLASS"), String)
                        If ((strRet Is Nothing) _
                                    OrElse (strRet Is String.Empty)) Then
                            strRet = CreatedClassName
                        End If
                    End If
                End If
                Return strRet
            End Get
        End Property

        'Property pointing to an embedded object to get System properties of the WMI object.
        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property SystemProperties() As ManagementSystemProperties
            Get
                Return PrivateSystemProperties
            End Get
        End Property

        'Property returning the underlying lateBound object.
        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property LateBoundObject() As System.Management.ManagementBaseObject
            Get
                Return curObj
            End Get
        End Property

        'ManagementScope of the object.
        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public Property Scope() As System.Management.ManagementScope
            Get
                If (isEmbedded = False) Then
                    Return PrivateLateBoundObject.Scope
                Else
                    Return Nothing
                End If
            End Get
            Set(ByVal value As System.Management.ManagementScope)
                If (isEmbedded = False) Then
                    PrivateLateBoundObject.Scope = value
                End If
            End Set
        End Property

        'Property to show the commit behavior for the WMI object. If true, WMI object will be automatically saved after each property modification.(ie. Put() is called after modification of a property).
        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public Property AutoCommit() As Boolean
            Get
                Return AutoCommitProp
            End Get
            Set(ByVal value As Boolean)
                AutoCommitProp = value
            End Set
        End Property

        'The ManagementPath of the underlying WMI object.
        <Browsable(True)> _
        Public Property Path() As System.Management.ManagementPath
            Get
                If (isEmbedded = False) Then
                    Return PrivateLateBoundObject.Path
                Else
                    Return Nothing
                End If
            End Get
            Set(ByVal value As System.Management.ManagementPath)
                If (isEmbedded = False) Then
                    If (CheckIfProperClass(Nothing, value, Nothing) <> True) Then
                        Throw New System.ArgumentException("Class name does not match.")
                    End If
                    PrivateLateBoundObject.Path = value
                End If
            End Set
        End Property

        'Public static scope property which is used by the various methods.
        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public Shared Property StaticScope() As System.Management.ManagementScope
            Get
                Return statMgmtScope
            End Get
            Set(ByVal value As System.Management.ManagementScope)
                statMgmtScope = value
            End Set
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The BootDevice property indicates the name of the disk drive from which the Win32" & _
            " operating system boots. " & Global.Microsoft.VisualBasic.ChrW(10) & "Example: \\Device\Harddisk0.")> _
        Public ReadOnly Property BootDevice() As String
            Get
                Return CType(curObj("BootDevice"), String)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The BuildNumber property indicates the build number of the operating system.  It " & _
            "can be used for more precise versioning information than product release version" & _
            " numbers" & Global.Microsoft.VisualBasic.ChrW(10) & "Example: 1381")> _
        Public ReadOnly Property BuildNumber() As String
            Get
                Return CType(curObj("BuildNumber"), String)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The BuildType property indicates the type of build used for the operating system." & _
            " Examples are retail build and checked build.")> _
        Public ReadOnly Property BuildType() As String
            Get
                Return CType(curObj("BuildType"), String)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The Caption property is a short textual description (one-line string) of the obje" & _
            "ct.")> _
        Public ReadOnly Property Caption() As String
            Get
                Return CType(curObj("Caption"), String)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The CodeSet property indicates the code page value used by the operating system. " & _
            "A code page contains a character table used by the operating system to translate" & _
            " strings for different languages. The American National Standards Institute (ANS" & _
            "I) lists values that represent defined code pages. If the operating system does " & _
            "not use an ANSI code page, this member will be set to 0. The CodeSet string can " & _
            "use up to six characters to define the code page value." & Global.Microsoft.VisualBasic.ChrW(10) & "Example: 1255.")> _
        Public ReadOnly Property CodeSet() As String
            Get
                Return CType(curObj("CodeSet"), String)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The CountryCode property indicates the code for the country/regionused by the ope" & _
            "rating system. Values are based on international phone dialing prefixes (also re" & _
            "ferred to as IBM country/region codes). The CountryCode string can use up to six" & _
            " characters to define the country/region code value." & Global.Microsoft.VisualBasic.ChrW(10) & "Example: 1 for the United S" & _
            "tates)")> _
        Public ReadOnly Property CountryCode() As String
            Get
                Return CType(curObj("CountryCode"), String)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("CreationClassName indicates the name of the class or the subclass used in the cre" & _
            "ation of an instance. When used with the other key properties of this class, thi" & _
            "s property allows all instances of this class and its subclasses to be uniquely " & _
            "identified.")> _
        Public ReadOnly Property CreationClassName() As String
            Get
                Return CType(curObj("CreationClassName"), String)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("CSCreationClassName contains the scoping computer system's creation class name.")> _
        Public ReadOnly Property CSCreationClassName() As String
            Get
                Return CType(curObj("CSCreationClassName"), String)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The CSDVersion property contains a null-terminated string, that indicates the lat" & _
            "est Service Pack installed on the computer system. If no Service Pack is install" & _
            "ed, the string is NULL. For computer systems running Windows 95, this property c" & _
            "ontains a null-terminated string that provides arbitrary additional information " & _
            "about the operating system." & Global.Microsoft.VisualBasic.ChrW(10) & "Example: Service Pack 3.")> _
        Public ReadOnly Property CSDVersion() As String
            Get
                Return CType(curObj("CSDVersion"), String)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("CSName contains the scoping computer system's name.")> _
        Public ReadOnly Property CSName() As String
            Get
                Return CType(curObj("CSName"), String)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsCurrentTimeZoneNull() As Boolean
            Get
                If (curObj("CurrentTimeZone") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("CurrentTimeZone indicates the number of minutes the operating system is offset fr" & _
            "om Greenwich Mean Time. Either the number is positive, negative or zero."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property CurrentTimeZone() As Short
            Get
                If (curObj("CurrentTimeZone") Is Nothing) Then
                    Return System.Convert.ToInt16(0)
                End If
                Return CType(curObj("CurrentTimeZone"), Short)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsDataExecutionPrevention_32BitApplicationsNull() As Boolean
            Get
                If (curObj("DataExecutionPrevention_32BitApplications") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("If true, indicates that 32-bit applications are running with Data Execution Preve" & _
            "ntion (DEP) applied. (false if DataExecutionPrevention_Available = false)"), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property DataExecutionPrevention_32BitApplications() As Boolean
            Get
                If (curObj("DataExecutionPrevention_32BitApplications") Is Nothing) Then
                    Return System.Convert.ToBoolean(0)
                End If
                Return CType(curObj("DataExecutionPrevention_32BitApplications"), Boolean)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsDataExecutionPrevention_AvailableNull() As Boolean
            Get
                If (curObj("DataExecutionPrevention_Available") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("If true, indicates that the hardware supports Windows Data Execution Prevention (" & _
            "DEP) technology. DEP ensures that all memory locations are marked with a non-exe" & _
            "cutable attribute unless the memory location explicitly contains executable code" & _
            ".  This can help mitigate certain types of buffer overrun security exploits.  If" & _
            " DEP is available, 64-bit applications are automatically protected.  To determin" & _
            "e if DEP has been enabled for 32-bit applications and drivers, use the DataExecu" & _
            "tionPrevention_ properties "), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property DataExecutionPrevention_Available() As Boolean
            Get
                If (curObj("DataExecutionPrevention_Available") Is Nothing) Then
                    Return System.Convert.ToBoolean(0)
                End If
                Return CType(curObj("DataExecutionPrevention_Available"), Boolean)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsDataExecutionPrevention_DriversNull() As Boolean
            Get
                If (curObj("DataExecutionPrevention_Drivers") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("If true, indicates that drivers are running with Data Execution Prevention (DEP) " & _
            "applied. (false if DataExecutionPrevention_Available = false)"), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property DataExecutionPrevention_Drivers() As Boolean
            Get
                If (curObj("DataExecutionPrevention_Drivers") Is Nothing) Then
                    Return System.Convert.ToBoolean(0)
                End If
                Return CType(curObj("DataExecutionPrevention_Drivers"), Boolean)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsDataExecutionPrevention_SupportPolicyNull() As Boolean
            Get
                If (curObj("DataExecutionPrevention_SupportPolicy") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The DataExecutionPrevention_SupportPolicy indicates which one of four Data Execut" & _
            "ion Prevention (DEP) settings is applied. Each setting varies by the extent to w" & _
            "hich DEP is applied to 32-bit applications.  Note that DEP is always applied to " & _
            "the Windows kernel. Always On (not available in the user interface) indicates th" & _
            "at DEP is enabled for all 32-bit applications on the machine with no new System.data.DataColumns." & _
            " OptOut indicates DEP is on by default for all 32-bit applications and that a us" & _
            "er or administrator must explicitly remove support for a 32-bit application by a" & _
            "dding to an new System.data.DataColumns list. OptIn indicates DEP is on for a limited number of b" & _
            "inaries, the kernel, and all Windows services but it is off by default for all 3" & _
            "2-bit applications; a user or administrator must explicitly choose the AlwaysOn " & _
            "(not available in the user interface) or OptOut setting before DEP can be applie" & _
            "d to 32-bit applications.  AlwaysOff (not available in the user interface) indic" & _
            "ates DEP is turned off for all 32-bit applications on the machine. "), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property DataExecutionPrevention_SupportPolicy() As DataExecutionPrevention_SupportPolicyValues
            Get
                If (curObj("DataExecutionPrevention_SupportPolicy") Is Nothing) Then
                    Return CType(System.Convert.ToInt32(4), DataExecutionPrevention_SupportPolicyValues)
                End If
                Return CType(System.Convert.ToInt32(curObj("DataExecutionPrevention_SupportPolicy")), DataExecutionPrevention_SupportPolicyValues)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsDebugNull() As Boolean
            Get
                If (curObj("Debug") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The Debug property indicates whether the operating system is a checked (debug) bu" & _
            "ild. Checked builds provide error checking, argument verification, and system de" & _
            "bugging code. Additional code in a checked binary generates a kernel debugger er" & _
            "ror message and breaks into the debugger. This helps  immediately determine the " & _
            "cause and location of the error. Performance suffers in the checked build due to" & _
            " the additional code that is executed." & Global.Microsoft.VisualBasic.ChrW(10) & "Values: TRUE or FALSE, A value of TRUE in" & _
            "dicates the debugging version of User.exe is installed."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property Debug() As Boolean
            Get
                If (curObj("Debug") Is Nothing) Then
                    Return System.Convert.ToBoolean(0)
                End If
                Return CType(curObj("Debug"), Boolean)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The Description property provides a description of the Windows operating system. " & _
            "Some user interfaces (those that allow editing of this description) limit its le" & _
            "ngth to 48 characters.")> _
        Public Property Description() As String
            Get
                Return CType(curObj("Description"), String)
            End Get
            Set(ByVal value As String)
                curObj("Description") = value
                If ((isEmbedded = False) _
                            AndAlso (AutoCommitProp = True)) Then
                    PrivateLateBoundObject.Put()
                End If
            End Set
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsDistributedNull() As Boolean
            Get
                If (curObj("Distributed") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("Boolean indicating whether the operating system is distributed across several com" & _
            "puter system nodes. If so, these nodes should be grouped as a cluster."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property Distributed() As Boolean
            Get
                If (curObj("Distributed") Is Nothing) Then
                    Return System.Convert.ToBoolean(0)
                End If
                Return CType(curObj("Distributed"), Boolean)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsEncryptionLevelNull() As Boolean
            Get
                If (curObj("EncryptionLevel") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The EncryptionLevel property specifies if the encryption level for secure transac" & _
            "tions is 40-bit, 128-bit, or n-bit encryption."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property EncryptionLevel() As EncryptionLevelValues
            Get
                If (curObj("EncryptionLevel") Is Nothing) Then
                    Return CType(System.Convert.ToInt32(3), EncryptionLevelValues)
                End If
                Return CType(System.Convert.ToInt32(curObj("EncryptionLevel")), EncryptionLevelValues)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsForegroundApplicationBoostNull() As Boolean
            Get
                If (curObj("ForegroundApplicationBoost") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The ForegroundApplicationBoost property indicates the increase in priority given " & _
            "to the foreground application. On computer systems running Windows NT 4.0 and Wi" & _
            "ndows 2000, application boost is implemented by giving an application more execu" & _
            "tion time slices (quantum lengths). A ForegroundApplicationBoost value of 0 indi" & _
            "cates the system boosts the quantum length by 6; if 1, then 12; and if 2 then 18" & _
            ". On Windows NT 3.51 and earlier, application boost is implemented by increasing" & _
            " the scheduling priority. For these systems, the scheduling priority is increase" & _
            "d by the value of this property. The default value is 2."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public Property ForegroundApplicationBoost() As ForegroundApplicationBoostValues
            Get
                If (curObj("ForegroundApplicationBoost") Is Nothing) Then
                    Return CType(System.Convert.ToInt32(3), ForegroundApplicationBoostValues)
                End If
                Return CType(System.Convert.ToInt32(curObj("ForegroundApplicationBoost")), ForegroundApplicationBoostValues)
            End Get
            Set(ByVal value As ForegroundApplicationBoostValues)
                If (ForegroundApplicationBoostValues.NULL_ENUM_VALUE = value) Then
                    curObj("ForegroundApplicationBoost") = Nothing
                Else
                    curObj("ForegroundApplicationBoost") = value
                End If
                If ((isEmbedded = False) _
                            AndAlso (AutoCommitProp = True)) Then
                    PrivateLateBoundObject.Put()
                End If
            End Set
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsFreePhysicalMemoryNull() As Boolean
            Get
                If (curObj("FreePhysicalMemory") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("Number of kilobytes of physical memory currently unused and available"), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property FreePhysicalMemory() As ULong
            Get
                If (curObj("FreePhysicalMemory") Is Nothing) Then
                    Return System.Convert.ToUInt64(0)
                End If
                Return CType(curObj("FreePhysicalMemory"), ULong)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsFreeSpaceInPagingFilesNull() As Boolean
            Get
                If (curObj("FreeSpaceInPagingFiles") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The total number of KBytes that can be mapped into the OperatingSystem's paging f" & _
            "iles without causing any other pages to be swapped out. 0 indicates that there a" & _
            "re no paging files."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property FreeSpaceInPagingFiles() As ULong
            Get
                If (curObj("FreeSpaceInPagingFiles") Is Nothing) Then
                    Return System.Convert.ToUInt64(0)
                End If
                Return CType(curObj("FreeSpaceInPagingFiles"), ULong)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsFreeVirtualMemoryNull() As Boolean
            Get
                If (curObj("FreeVirtualMemory") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("Number of kilobytes of virtual memory currently unused and available. For example" & _
            ", this may be calculated by adding the amount of free RAM to the amount of free " & _
            "paging space (i.e., adding the properties, FreePhysicalMemory and FreeSpaceInPag" & _
            "ingFiles)."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property FreeVirtualMemory() As ULong
            Get
                If (curObj("FreeVirtualMemory") Is Nothing) Then
                    Return System.Convert.ToUInt64(0)
                End If
                Return CType(curObj("FreeVirtualMemory"), ULong)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsInstallDateNull() As Boolean
            Get
                If (curObj("InstallDate") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The InstallDate property is datetime value indicating when the object was install" & _
            "ed. A lack of a value does not indicate that the object is not installed."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property InstallDate() As Date
            Get
                If (Not (curObj("InstallDate")) Is Nothing) Then
                    Return ToDateTime(CType(curObj("InstallDate"), String))
                Else
                    Return Date.MinValue
                End If
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsLargeSystemCacheNull() As Boolean
            Get
                If (curObj("LargeSystemCache") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The LargeSystemCache property indicates whether to optimize memory for applicatio" & _
            "ns (value=0) or for system performance (value=1)."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property LargeSystemCache() As LargeSystemCacheValues
            Get
                If (curObj("LargeSystemCache") Is Nothing) Then
                    Return CType(System.Convert.ToInt32(2), LargeSystemCacheValues)
                End If
                Return CType(System.Convert.ToInt32(curObj("LargeSystemCache")), LargeSystemCacheValues)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsLastBootUpTimeNull() As Boolean
            Get
                If (curObj("LastBootUpTime") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("Time when the operating system was last booted"), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property LastBootUpTime() As Date
            Get
                If (Not (curObj("LastBootUpTime")) Is Nothing) Then
                    Return ToDateTime(CType(curObj("LastBootUpTime"), String))
                Else
                    Return Date.MinValue
                End If
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsLocalDateTimeNull() As Boolean
            Get
                If (curObj("LocalDateTime") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("Operating system's notion of the local date and time of day."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property LocalDateTime() As Date
            Get
                If (Not (curObj("LocalDateTime")) Is Nothing) Then
                    Return ToDateTime(CType(curObj("LocalDateTime"), String))
                Else
                    Return Date.MinValue
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The Locale property indicates the language identifier used by the operating syste" & _
            "m. A language identifier is a standard international numeric abbreviation for a " & _
            "country or region. Each language has a unique language identifier (LANGID), a 16" & _
            "-bit value that consists of a primary language identifier and a secondary langua" & _
            "ge identifier.")> _
        Public ReadOnly Property Locale() As String
            Get
                Return CType(curObj("Locale"), String)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The Manufacturer property indicates the name of the operating system manufacturer" & _
            ".  For Win32 systems this value will be Microsoft Corporation.")> _
        Public ReadOnly Property Manufacturer() As String
            Get
                Return CType(curObj("Manufacturer"), String)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsMaxNumberOfProcessesNull() As Boolean
            Get
                If (curObj("MaxNumberOfProcesses") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("Maximum number of process contexts the operating system can support. If there is " & _
            "no fixed maximum, the value should be 0. On systems that have a fixed maximum, t" & _
            "his object can help diagnose failures that occur when the maximum is reached. If" & _
            " unknown, enter -1."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property MaxNumberOfProcesses() As UInteger
            Get
                If (curObj("MaxNumberOfProcesses") Is Nothing) Then
                    Return System.Convert.ToUInt32(0)
                End If
                Return CType(curObj("MaxNumberOfProcesses"), UInteger)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsMaxProcessMemorySizeNull() As Boolean
            Get
                If (curObj("MaxProcessMemorySize") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("Maximum number of kilobytes of memory that can be allocated to a process. For ope" & _
            "rating systems with no virtual memory, this value is typically equal to the tota" & _
            "l amount of physical memory minus memory used by the BIOS and OS. For some opera" & _
            "ting systems, this value may be infinity - in which case, 0 should be entered. I" & _
            "n other cases, this value could be a constant - for example, 2G or 4G."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property MaxProcessMemorySize() As ULong
            Get
                If (curObj("MaxProcessMemorySize") Is Nothing) Then
                    Return System.Convert.ToUInt64(0)
                End If
                Return CType(curObj("MaxProcessMemorySize"), ULong)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The MUILanguages property indicates the MUI Languages installed in the system. " & Global.Microsoft.VisualBasic.ChrW(10) & " " & _
            "Example: en-us.")> _
        Public ReadOnly Property MUILanguages() As String()
            Get
                Return CType(curObj("MUILanguages"), String())
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("Name of the operating system instance within a computer system.")> _
        Public ReadOnly Property Name() As String
            Get
                Return CType(curObj("Name"), String)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsNumberOfLicensedUsersNull() As Boolean
            Get
                If (curObj("NumberOfLicensedUsers") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("Number of user licenses for the operating system. If unlimited, enter 0. If unkno" & _
            "wn, enter -1."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property NumberOfLicensedUsers() As UInteger
            Get
                If (curObj("NumberOfLicensedUsers") Is Nothing) Then
                    Return System.Convert.ToUInt32(0)
                End If
                Return CType(curObj("NumberOfLicensedUsers"), UInteger)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsNumberOfProcessesNull() As Boolean
            Get
                If (curObj("NumberOfProcesses") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("Number of process contexts currently loaded or running on the operating system."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property NumberOfProcesses() As UInteger
            Get
                If (curObj("NumberOfProcesses") Is Nothing) Then
                    Return System.Convert.ToUInt32(0)
                End If
                Return CType(curObj("NumberOfProcesses"), UInteger)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsNumberOfUsersNull() As Boolean
            Get
                If (curObj("NumberOfUsers") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("Number of user sessions for which the operating system is currently storing state" & _
            " information"), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property NumberOfUsers() As UInteger
            Get
                If (curObj("NumberOfUsers") Is Nothing) Then
                    Return System.Convert.ToUInt32(0)
                End If
                Return CType(curObj("NumberOfUsers"), UInteger)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsOperatingSystemSKUNull() As Boolean
            Get
                If (curObj("OperatingSystemSKU") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The OperatingSystemSKU property identifies the SKU of the operating system."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property OperatingSystemSKU() As UInteger
            Get
                If (curObj("OperatingSystemSKU") Is Nothing) Then
                    Return System.Convert.ToUInt32(0)
                End If
                Return CType(curObj("OperatingSystemSKU"), UInteger)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The Organization property indicates the registered user's (of the operating syste" & _
            "m) company name." & Global.Microsoft.VisualBasic.ChrW(10) & "Example: Microsoft Corporation.")> _
        Public ReadOnly Property Organization() As String
            Get
                Return CType(curObj("Organization"), String)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The OSArchitecture property indicates the Architecture of the operating system.Ex" & _
            "ample: 32-bit, 64-bit Intel, 64-bit AMD ")> _
        Public ReadOnly Property OSArchitecture() As String
            Get
                Return CType(curObj("OSArchitecture"), String)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsOSLanguageNull() As Boolean
            Get
                If (curObj("OSLanguage") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The OSLanguage property indicates which language version of the operating system " & _
            "is installed." & Global.Microsoft.VisualBasic.ChrW(10) & "Example: 0x0807 (German, Switzerland)"), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property OSLanguage() As UInteger
            Get
                If (curObj("OSLanguage") Is Nothing) Then
                    Return System.Convert.ToUInt32(0)
                End If
                Return CType(curObj("OSLanguage"), UInteger)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsOSProductSuiteNull() As Boolean
            Get
                If (curObj("OSProductSuite") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The OSProductSuite property identifies installed and licensed system product addi" & _
            "tions to the operating system."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property OSProductSuite() As OSProductSuiteValues
            Get
                If (curObj("OSProductSuite") Is Nothing) Then
                    Return CType(System.Convert.ToInt32(256), OSProductSuiteValues)
                End If
                Return CType(System.Convert.ToInt32(curObj("OSProductSuite")), OSProductSuiteValues)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsOSTypeNull() As Boolean
            Get
                If (curObj("OSType") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("A integer indicating the type of operating system."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property OSType() As OSTypeValues
            Get
                If (curObj("OSType") Is Nothing) Then
                    Return CType(System.Convert.ToInt32(63), OSTypeValues)
                End If
                Return CType(System.Convert.ToInt32(curObj("OSType")), OSTypeValues)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("A string describing the manufacturer and operating system type - used when the op" & _
            "erating system property, OSType, is set to 1 (""Other""). The format of the string" & _
            " inserted in OtherTypeDescription should be similar in format to the Values stri" & _
            "ngs defined for OSType.  OtherTypeDescription should be set to NULL when OSType " & _
            "is any value other than 1.")> _
        Public ReadOnly Property OtherTypeDescription() As String
            Get
                Return CType(curObj("OtherTypeDescription"), String)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsPAEEnabledNull() As Boolean
            Get
                If (curObj("PAEEnabled") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property PAEEnabled() As Boolean
            Get
                If (curObj("PAEEnabled") Is Nothing) Then
                    Return System.Convert.ToBoolean(0)
                End If
                Return CType(curObj("PAEEnabled"), Boolean)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The PlusProductID property contains the product identification number for the Win" & _
            "dows Plus! operating system enhancement software (if installed).")> _
        Public ReadOnly Property PlusProductID() As String
            Get
                Return CType(curObj("PlusProductID"), String)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The PlusVersionNumber property contains the version number of the Windows Plus! o" & _
            "perating system enhancement software (if installed).")> _
        Public ReadOnly Property PlusVersionNumber() As String
            Get
                Return CType(curObj("PlusVersionNumber"), String)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsPrimaryNull() As Boolean
            Get
                If (curObj("Primary") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The Primary property determines whether this is the primary operating system." & Global.Microsoft.VisualBasic.ChrW(10) & "Val" & _
            "ues: TRUE or FALSE. A value of TRUE indicates this is the primary operating syst" & _
            "em."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property Primary() As Boolean
            Get
                If (curObj("Primary") Is Nothing) Then
                    Return System.Convert.ToBoolean(0)
                End If
                Return CType(curObj("Primary"), Boolean)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsProductTypeNull() As Boolean
            Get
                If (curObj("ProductType") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The ProductType property indicates additional information about the system. This " & _
            "member can be one of the following values: " & Global.Microsoft.VisualBasic.ChrW(10) & "1 - Work Station " & Global.Microsoft.VisualBasic.ChrW(10) & "2 - Domain Control" & _
            "ler " & Global.Microsoft.VisualBasic.ChrW(10) & "3 - Server"), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property ProductType() As ProductTypeValues
            Get
                If (curObj("ProductType") Is Nothing) Then
                    Return CType(System.Convert.ToInt32(0), ProductTypeValues)
                End If
                Return CType(System.Convert.ToInt32(curObj("ProductType")), ProductTypeValues)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsQuantumLengthNull() As Boolean
            Get
                If (curObj("QuantumLength") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The QuantumLength property defines the number of clock ticks per quantum. A quant" & _
            "um is a unit of execution time that the scheduler is allowed to give to an appli" & _
            "cation before switching to other applications. When a thread runs one quantum, t" & _
            "he kernel preempts it and moves it to the end of a queue for applications with e" & _
            "qual priorities. The actual length of a thread's quantum varies across different" & _
            " Windows platforms. For Windows NT/Windows 2000 only."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public Property QuantumLength() As QuantumLengthValues
            Get
                If (curObj("QuantumLength") Is Nothing) Then
                    Return CType(System.Convert.ToInt32(3), QuantumLengthValues)
                End If
                Return CType(System.Convert.ToInt32(curObj("QuantumLength")), QuantumLengthValues)
            End Get
            Set(ByVal value As QuantumLengthValues)
                If (QuantumLengthValues.NULL_ENUM_VALUE = value) Then
                    curObj("QuantumLength") = Nothing
                Else
                    curObj("QuantumLength") = value
                End If
                If ((isEmbedded = False) _
                            AndAlso (AutoCommitProp = True)) Then
                    PrivateLateBoundObject.Put()
                End If
            End Set
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsQuantumTypeNull() As Boolean
            Get
                If (curObj("QuantumType") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The QuantumType property specifies either fixed or variable length quantums. Wind" & _
            "ows NT 4.0 Workstation/Windows 2000 defaults to variable length quantums where t" & _
            "he foreground application has a longer quantum than the background applications." & _
            " Windows NT Server defaults to fixed-length quantums. A quantum is a unit of exe" & _
            "cution time that the scheduler is allowed to give to an application before switc" & _
            "hing to another application. When a thread runs one quantum, the kernel preempts" & _
            " it and moves it to the end of a queue for applications with equal priorities. T" & _
            "he actual length of a thread's quantum varies across different Windows platforms" & _
            ". For Windows NT/Windows 2000 only." & Global.Microsoft.VisualBasic.ChrW(10) & "The property can take the following values: " & _
            "" & Global.Microsoft.VisualBasic.ChrW(10) & "0 = Unkown - Quantum Type not known." & Global.Microsoft.VisualBasic.ChrW(10) & "1 = Fixed - Quantum length is fixed." & Global.Microsoft.VisualBasic.ChrW(10) & "2 = V" & _
            "ariable - Quantum length is variable."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public Property QuantumType() As QuantumTypeValues
            Get
                If (curObj("QuantumType") Is Nothing) Then
                    Return CType(System.Convert.ToInt32(3), QuantumTypeValues)
                End If
                Return CType(System.Convert.ToInt32(curObj("QuantumType")), QuantumTypeValues)
            End Get
            Set(ByVal value As QuantumTypeValues)
                If (QuantumTypeValues.NULL_ENUM_VALUE = value) Then
                    curObj("QuantumType") = Nothing
                Else
                    curObj("QuantumType") = value
                End If
                If ((isEmbedded = False) _
                            AndAlso (AutoCommitProp = True)) Then
                    PrivateLateBoundObject.Put()
                End If
            End Set
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The RegisteredUser property indicates the name of the registered user of the oper" & _
            "ating system." & Global.Microsoft.VisualBasic.ChrW(10) & "Example: Jane Doe")> _
        Public ReadOnly Property RegisteredUser() As String
            Get
                Return CType(curObj("RegisteredUser"), String)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The SerialNumber property indicates the operating system product serial identific" & _
            "ation number." & Global.Microsoft.VisualBasic.ChrW(10) & "Example:10497-OEM-0031416-71674.")> _
        Public ReadOnly Property SerialNumber() As String
            Get
                Return CType(curObj("SerialNumber"), String)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsServicePackMajorVersionNull() As Boolean
            Get
                If (curObj("ServicePackMajorVersion") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The ServicePackMajorVersion property indicates the major version number of the se" & _
            "rvice pack installed on the computer system. If no service pack has been install" & _
            "ed, the value is zero. ServicePackMajorVersion is valid for computers running Wi" & _
            "ndows 2000 and later (NULL otherwise)."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property ServicePackMajorVersion() As UShort
            Get
                If (curObj("ServicePackMajorVersion") Is Nothing) Then
                    Return System.Convert.ToUInt16(0)
                End If
                Return CType(curObj("ServicePackMajorVersion"), UShort)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsServicePackMinorVersionNull() As Boolean
            Get
                If (curObj("ServicePackMinorVersion") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The ServicePackMinorVersion property indicates the minor version number of the se" & _
            "rvice pack installed on the computer system. If no service pack has been install" & _
            "ed, the value is zero. ServicePackMinorVersion is valid for computers running Wi" & _
            "ndows 2000 and later (NULL otherwise)."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property ServicePackMinorVersion() As UShort
            Get
                If (curObj("ServicePackMinorVersion") Is Nothing) Then
                    Return System.Convert.ToUInt16(0)
                End If
                Return CType(curObj("ServicePackMinorVersion"), UShort)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsSizeStoredInPagingFilesNull() As Boolean
            Get
                If (curObj("SizeStoredInPagingFiles") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The total number of kilobytes that can be stored in the operating system's paging" & _
            " files. Note that this number does not represent the actual physical size of the" & _
            " paging file on disk.  0 indicates that there are no paging files."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property SizeStoredInPagingFiles() As ULong
            Get
                If (curObj("SizeStoredInPagingFiles") Is Nothing) Then
                    Return System.Convert.ToUInt64(0)
                End If
                Return CType(curObj("SizeStoredInPagingFiles"), ULong)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The Status property is a string indicating the current status of the object. Vari" & _
            "ous operational and non-operational statuses can be defined. Operational statuse" & _
            "s are ""OK"", ""Degraded"" and ""Pred Fail"". ""Pred Fail"" indicates that an element ma" & _
            "y be functioning properly but predicting a failure in the near future. An exampl" & _
            "e is a SMART-enabled hard drive. Non-operational statuses can also be specified." & _
            " These are ""Error"", ""Starting"", ""Stopping"" and ""Service"". The latter, ""Service""," & _
            " could apply during mirror-resilvering of a disk, reload of a user permissions l" & _
            "ist, or other administrative work. Not all such work is on-line, yet the managed" & _
            " element is neither ""OK"" nor in one of the other states.")> _
        Public ReadOnly Property Status() As String
            Get
                Return CType(curObj("Status"), String)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsSuiteMaskNull() As Boolean
            Get
                If (curObj("SuiteMask") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The SuiteMask property indicates a set of bit flags that identify the product sui" & _
            "tes available on the system. This member can be a combination of the following v" & _
            "alues: " & Global.Microsoft.VisualBasic.ChrW(10) & "0 - Windows Server 2003, Small Business Edition " & Global.Microsoft.VisualBasic.ChrW(10) & "1 - Windows Server 2003" & _
            ", Enterprise Edition " & Global.Microsoft.VisualBasic.ChrW(10) & "2 - Windows Server 2003, Backoffice Edition " & Global.Microsoft.VisualBasic.ChrW(10) & "3 - Windows S" & _
            "erver 2003, Communications Edition " & Global.Microsoft.VisualBasic.ChrW(10) & "4 - Microsoft Terminal Services " & Global.Microsoft.VisualBasic.ChrW(10) & "5 - Windows" & _
            " Server 2003, Small Business Edition Restricted " & Global.Microsoft.VisualBasic.ChrW(10) & "6 - Windows XP Embedded " & Global.Microsoft.VisualBasic.ChrW(10) & "7 - Wi" & _
            "ndows Server 2003, Datacenter Edition " & Global.Microsoft.VisualBasic.ChrW(10) & "8 - Single User " & Global.Microsoft.VisualBasic.ChrW(10) & "9 - Windows XP Home Edit" & _
            "ion " & Global.Microsoft.VisualBasic.ChrW(10) & "10 - Windows Server 2003, Web Edition"), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property SuiteMask() As SuiteMaskValues
            Get
                If (curObj("SuiteMask") Is Nothing) Then
                    Return CType(System.Convert.ToInt32(20), SuiteMaskValues)
                End If
                Return CType(System.Convert.ToInt32(curObj("SuiteMask")), SuiteMaskValues)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The SystemDevice property indicates the physical disk partition the operating sys" & _
            "tem is installed on.")> _
        Public ReadOnly Property SystemDevice() As String
            Get
                Return CType(curObj("SystemDevice"), String)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The SystemDirectory property indicates the system directory of the operating syst" & _
            "em." & Global.Microsoft.VisualBasic.ChrW(10) & "Example: C:\WINDOWS\SYSTEM32")> _
        Public ReadOnly Property SystemDirectory() As String
            Get
                Return CType(curObj("SystemDirectory"), String)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The SystemDrive property contains the letter of the disk drive that the operating" & _
            " system resides on." & Global.Microsoft.VisualBasic.ChrW(10) & "Example: C:")> _
        Public ReadOnly Property SystemDrive() As String
            Get
                Return CType(curObj("SystemDrive"), String)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsTotalSwapSpaceSizeNull() As Boolean
            Get
                If (curObj("TotalSwapSpaceSize") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("Total swap space in kilobytes. This value may be NULL (unspecified) if swap space" & _
            " is not distinguished from page files.  However, some operating systems distingu" & _
            "ish these concepts.  For example, in UNIX, whole processes can be 'swapped out' " & _
            "when the free page list falls and remains below a specified amount."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property TotalSwapSpaceSize() As ULong
            Get
                If (curObj("TotalSwapSpaceSize") Is Nothing) Then
                    Return System.Convert.ToUInt64(0)
                End If
                Return CType(curObj("TotalSwapSpaceSize"), ULong)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsTotalVirtualMemorySizeNull() As Boolean
            Get
                If (curObj("TotalVirtualMemorySize") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("Number of kilobytes of virtual memory. For example, this may be calculated by add" & _
            "ing the amount of total RAM to the amount of paging space (i.e., adding the amou" & _
            "nt of memory in/aggregated by the computer system to the property, SizeStoredInP" & _
            "agingFiles."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property TotalVirtualMemorySize() As ULong
            Get
                If (curObj("TotalVirtualMemorySize") Is Nothing) Then
                    Return System.Convert.ToUInt64(0)
                End If
                Return CType(curObj("TotalVirtualMemorySize"), ULong)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsTotalVisibleMemorySizeNull() As Boolean
            Get
                If (curObj("TotalVisibleMemorySize") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The total amount of physical memory (in Kbytes) available to the OperatingSystem." & _
            " This value does not necessarily indicate the true amount of physical memory, bu" & _
            "t what is reported to the OperatingSystem as available to it."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property TotalVisibleMemorySize() As ULong
            Get
                If (curObj("TotalVisibleMemorySize") Is Nothing) Then
                    Return System.Convert.ToUInt64(0)
                End If
                Return CType(curObj("TotalVisibleMemorySize"), ULong)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The Version property indicates the version number of the operating system." & Global.Microsoft.VisualBasic.ChrW(10) & "Exampl" & _
            "e: 4.0")> _
        Public ReadOnly Property Version() As String
            Get
                Return CType(curObj("Version"), String)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The WindowsDirectory property indicates the Windows directory of the operating sy" & _
            "stem." & Global.Microsoft.VisualBasic.ChrW(10) & "Example: C:\WINDOWS")> _
        Public ReadOnly Property WindowsDirectory() As String
            Get
                Return CType(curObj("WindowsDirectory"), String)
            End Get
        End Property

        Private Overloads Function CheckIfProperClass(ByVal mgmtScope As System.Management.ManagementScope, ByVal path As System.Management.ManagementPath, ByVal OptionsParam As System.Management.ObjectGetOptions) As Boolean
            If ((Not (path) Is Nothing) _
                        AndAlso (String.Compare(path.ClassName, Me.ManagementClassName, True, System.Globalization.CultureInfo.InvariantCulture) = 0)) Then
                Return True
            Else
                Return CheckIfProperClass(New System.Management.ManagementObject(mgmtScope, path, OptionsParam))
            End If
        End Function

        Private Overloads Function CheckIfProperClass(ByVal theObj As System.Management.ManagementBaseObject) As Boolean
            If ((Not (theObj) Is Nothing) _
                        AndAlso (String.Compare(CType(theObj("__CLASS"), String), Me.ManagementClassName, True, System.Globalization.CultureInfo.InvariantCulture) = 0)) Then
                Return True
            Else
                Dim parentClasses As System.Array = CType(theObj("__DERIVATION"), System.Array)
                If (Not (parentClasses) Is Nothing) Then
                    Dim count As Integer = 0
                    count = 0
                    Do While (count < parentClasses.Length)
                        If (String.Compare(CType(parentClasses.GetValue(count), String), Me.ManagementClassName, True, System.Globalization.CultureInfo.InvariantCulture) = 0) Then
                            Return True
                        End If
                        count = (count + 1)
                    Loop
                End If
            End If
            Return False
        End Function

        Private Function ShouldSerializeCurrentTimeZone() As Boolean
            If (Me.IsCurrentTimeZoneNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeDataExecutionPrevention_32BitApplications() As Boolean
            If (Me.IsDataExecutionPrevention_32BitApplicationsNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeDataExecutionPrevention_Available() As Boolean
            If (Me.IsDataExecutionPrevention_AvailableNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeDataExecutionPrevention_Drivers() As Boolean
            If (Me.IsDataExecutionPrevention_DriversNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeDataExecutionPrevention_SupportPolicy() As Boolean
            If (Me.IsDataExecutionPrevention_SupportPolicyNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeDebug() As Boolean
            If (Me.IsDebugNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Sub ResetDescription()
            curObj("Description") = Nothing
            If ((isEmbedded = False) _
                        AndAlso (AutoCommitProp = True)) Then
                PrivateLateBoundObject.Put()
            End If
        End Sub

        Private Function ShouldSerializeDistributed() As Boolean
            If (Me.IsDistributedNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeEncryptionLevel() As Boolean
            If (Me.IsEncryptionLevelNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeForegroundApplicationBoost() As Boolean
            If (Me.IsForegroundApplicationBoostNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Sub ResetForegroundApplicationBoost()
            curObj("ForegroundApplicationBoost") = Nothing
            If ((isEmbedded = False) _
                        AndAlso (AutoCommitProp = True)) Then
                PrivateLateBoundObject.Put()
            End If
        End Sub

        Private Function ShouldSerializeFreePhysicalMemory() As Boolean
            If (Me.IsFreePhysicalMemoryNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeFreeSpaceInPagingFiles() As Boolean
            If (Me.IsFreeSpaceInPagingFilesNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeFreeVirtualMemory() As Boolean
            If (Me.IsFreeVirtualMemoryNull = False) Then
                Return True
            End If
            Return False
        End Function

        'Converts a given datetime in DMTF format to System.DateTime object.
        Shared Function ToDateTime(ByVal dmtfDate As String) As Date
            Dim initializer As Date = Date.MinValue
            Dim year As Integer = initializer.Year
            Dim month As Integer = initializer.Month
            Dim day As Integer = initializer.Day
            Dim hour As Integer = initializer.Hour
            Dim minute As Integer = initializer.Minute
            Dim second As Integer = initializer.Second
            Dim ticks As Long = 0
            Dim dmtf As String = dmtfDate
            Dim datetime As Date = Date.MinValue
            Dim tempString As String = String.Empty
            If (dmtf Is Nothing) Then
                Throw New System.ArgumentOutOfRangeException
            End If
            If (dmtf.Length = 0) Then
                Throw New System.ArgumentOutOfRangeException
            End If
            If (dmtf.Length <> 25) Then
                Throw New System.ArgumentOutOfRangeException
            End If
            Try
                tempString = dmtf.Substring(0, 4)
                If ("****" <> tempString) Then
                    year = Integer.Parse(tempString)
                End If
                tempString = dmtf.Substring(4, 2)
                If ("**" <> tempString) Then
                    month = Integer.Parse(tempString)
                End If
                tempString = dmtf.Substring(6, 2)
                If ("**" <> tempString) Then
                    day = Integer.Parse(tempString)
                End If
                tempString = dmtf.Substring(8, 2)
                If ("**" <> tempString) Then
                    hour = Integer.Parse(tempString)
                End If
                tempString = dmtf.Substring(10, 2)
                If ("**" <> tempString) Then
                    minute = Integer.Parse(tempString)
                End If
                tempString = dmtf.Substring(12, 2)
                If ("**" <> tempString) Then
                    second = Integer.Parse(tempString)
                End If
                tempString = dmtf.Substring(15, 6)
                If ("******" <> tempString) Then
                    ticks = (Long.Parse(tempString) * CType((System.TimeSpan.TicksPerMillisecond / 1000), Long))
                End If
                If ((((((((year < 0) _
                            OrElse (month < 0)) _
                            OrElse (day < 0)) _
                            OrElse (hour < 0)) _
                            OrElse (minute < 0)) _
                            OrElse (minute < 0)) _
                            OrElse (second < 0)) _
                            OrElse (ticks < 0)) Then
                    Throw New System.ArgumentOutOfRangeException
                End If
            Catch e As System.Exception
                Throw New System.ArgumentOutOfRangeException(Nothing, e.Message)
            End Try
            datetime = New Date(year, month, day, hour, minute, second, 0)
            datetime = datetime.AddTicks(ticks)
            Dim tickOffset As System.TimeSpan = System.TimeZone.CurrentTimeZone.GetUtcOffset(datetime)
            Dim UTCOffset As Integer = 0
            Dim OffsetToBeAdjusted As Integer = 0
            Dim OffsetMins As Long = CType((tickOffset.Ticks / System.TimeSpan.TicksPerMinute), Long)
            tempString = dmtf.Substring(22, 3)
            If (tempString <> "******") Then
                tempString = dmtf.Substring(21, 4)
                Try
                    UTCOffset = Integer.Parse(tempString)
                Catch e As System.Exception
                    Throw New System.ArgumentOutOfRangeException(Nothing, e.Message)
                End Try
                OffsetToBeAdjusted = CType((OffsetMins - UTCOffset), Integer)
                datetime = datetime.AddMinutes(CType(OffsetToBeAdjusted, Double))
            End If
            Return datetime
        End Function

        'Converts a given System.DateTime object to DMTF datetime format.
        Shared Function ToDmtfDateTime(ByVal [date] As Date) As String
            Dim utcString As String = String.Empty
            Dim tickOffset As System.TimeSpan = System.TimeZone.CurrentTimeZone.GetUtcOffset([date])
            Dim OffsetMins As Long = CType((tickOffset.Ticks / System.TimeSpan.TicksPerMinute), Long)
            If (System.Math.Abs(OffsetMins) > 999) Then
                [date] = [date].ToUniversalTime
                utcString = "+000"
            Else
                If (tickOffset.Ticks >= 0) Then
                    utcString = String.Concat("+", CType((tickOffset.Ticks / System.TimeSpan.TicksPerMinute), System.Int64).ToString.PadLeft(3, Global.Microsoft.VisualBasic.ChrW(48)))
                Else
                    Dim strTemp As String = CType(OffsetMins, System.Int64).ToString
                    utcString = String.Concat("-", strTemp.Substring(1, (strTemp.Length - 1)).PadLeft(3, Global.Microsoft.VisualBasic.ChrW(48)))
                End If
            End If
            Dim dmtfDateTime As String = CType([date].Year, System.Int32).ToString.PadLeft(4, Global.Microsoft.VisualBasic.ChrW(48))
            dmtfDateTime = String.Concat(dmtfDateTime, CType([date].Month, System.Int32).ToString.PadLeft(2, Global.Microsoft.VisualBasic.ChrW(48)))
            dmtfDateTime = String.Concat(dmtfDateTime, CType([date].Day, System.Int32).ToString.PadLeft(2, Global.Microsoft.VisualBasic.ChrW(48)))
            dmtfDateTime = String.Concat(dmtfDateTime, CType([date].Hour, System.Int32).ToString.PadLeft(2, Global.Microsoft.VisualBasic.ChrW(48)))
            dmtfDateTime = String.Concat(dmtfDateTime, CType([date].Minute, System.Int32).ToString.PadLeft(2, Global.Microsoft.VisualBasic.ChrW(48)))
            dmtfDateTime = String.Concat(dmtfDateTime, CType([date].Second, System.Int32).ToString.PadLeft(2, Global.Microsoft.VisualBasic.ChrW(48)))
            dmtfDateTime = String.Concat(dmtfDateTime, ".")
            Dim dtTemp As Date = New Date([date].Year, [date].Month, [date].Day, [date].Hour, [date].Minute, [date].Second, 0)
            Dim microsec As Long = CType(((([date].Ticks - dtTemp.Ticks) _
                        * 1000) _
                        / System.TimeSpan.TicksPerMillisecond), Long)
            Dim strMicrosec As String = CType(microsec, System.Int64).ToString
            If (strMicrosec.Length > 6) Then
                strMicrosec = strMicrosec.Substring(0, 6)
            End If
            dmtfDateTime = String.Concat(dmtfDateTime, strMicrosec.PadLeft(6, Global.Microsoft.VisualBasic.ChrW(48)))
            dmtfDateTime = String.Concat(dmtfDateTime, utcString)
            Return dmtfDateTime
        End Function

        Private Function ShouldSerializeInstallDate() As Boolean
            If (Me.IsInstallDateNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeLargeSystemCache() As Boolean
            If (Me.IsLargeSystemCacheNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeLastBootUpTime() As Boolean
            If (Me.IsLastBootUpTimeNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeLocalDateTime() As Boolean
            If (Me.IsLocalDateTimeNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeMaxNumberOfProcesses() As Boolean
            If (Me.IsMaxNumberOfProcessesNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeMaxProcessMemorySize() As Boolean
            If (Me.IsMaxProcessMemorySizeNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeNumberOfLicensedUsers() As Boolean
            If (Me.IsNumberOfLicensedUsersNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeNumberOfProcesses() As Boolean
            If (Me.IsNumberOfProcessesNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeNumberOfUsers() As Boolean
            If (Me.IsNumberOfUsersNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeOperatingSystemSKU() As Boolean
            If (Me.IsOperatingSystemSKUNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeOSLanguage() As Boolean
            If (Me.IsOSLanguageNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeOSProductSuite() As Boolean
            If (Me.IsOSProductSuiteNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeOSType() As Boolean
            If (Me.IsOSTypeNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializePAEEnabled() As Boolean
            If (Me.IsPAEEnabledNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializePrimary() As Boolean
            If (Me.IsPrimaryNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeProductType() As Boolean
            If (Me.IsProductTypeNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeQuantumLength() As Boolean
            If (Me.IsQuantumLengthNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Sub ResetQuantumLength()
            curObj("QuantumLength") = Nothing
            If ((isEmbedded = False) _
                        AndAlso (AutoCommitProp = True)) Then
                PrivateLateBoundObject.Put()
            End If
        End Sub

        Private Function ShouldSerializeQuantumType() As Boolean
            If (Me.IsQuantumTypeNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Sub ResetQuantumType()
            curObj("QuantumType") = Nothing
            If ((isEmbedded = False) _
                        AndAlso (AutoCommitProp = True)) Then
                PrivateLateBoundObject.Put()
            End If
        End Sub

        Private Function ShouldSerializeServicePackMajorVersion() As Boolean
            If (Me.IsServicePackMajorVersionNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeServicePackMinorVersion() As Boolean
            If (Me.IsServicePackMinorVersionNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeSizeStoredInPagingFiles() As Boolean
            If (Me.IsSizeStoredInPagingFilesNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeSuiteMask() As Boolean
            If (Me.IsSuiteMaskNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeTotalSwapSpaceSize() As Boolean
            If (Me.IsTotalSwapSpaceSizeNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeTotalVirtualMemorySize() As Boolean
            If (Me.IsTotalVirtualMemorySizeNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeTotalVisibleMemorySize() As Boolean
            If (Me.IsTotalVisibleMemorySizeNull = False) Then
                Return True
            End If
            Return False
        End Function

        <Browsable(True)> _
        Public Overloads Sub CommitObject()
            If (isEmbedded = False) Then
                PrivateLateBoundObject.Put()
            End If
        End Sub

        <Browsable(True)> _
        Public Overloads Sub CommitObject(ByVal putOptions As System.Management.PutOptions)
            If (isEmbedded = False) Then
                PrivateLateBoundObject.Put(putOptions)
            End If
        End Sub

        Private Sub Initialize()
            AutoCommitProp = True
            isEmbedded = False
        End Sub

        Private Shared Function ConstructPath() As String
            Return "root\cimv2:Win32_OperatingSystem=@"
        End Function

        Private Sub InitializeObject(ByVal mgmtScope As System.Management.ManagementScope, ByVal path As System.Management.ManagementPath, ByVal getOptions As System.Management.ObjectGetOptions)
            Initialize()
            If (Not (path) Is Nothing) Then
                If (CheckIfProperClass(mgmtScope, path, getOptions) <> True) Then
                    Throw New System.ArgumentException("Class name does not match.")
                End If
            End If
            PrivateLateBoundObject = New System.Management.ManagementObject(mgmtScope, path, getOptions)
            PrivateSystemProperties = New ManagementSystemProperties(PrivateLateBoundObject)
            curObj = PrivateLateBoundObject
        End Sub

        <Browsable(True)> _
        Public Shared Function CreateInstance() As OperatingSystem0
            Dim mgmtScope As System.Management.ManagementScope = Nothing
            If (statMgmtScope Is Nothing) Then
                mgmtScope = New System.Management.ManagementScope
                mgmtScope.Path.NamespacePath = CreatedWmiNamespace
            Else
                mgmtScope = statMgmtScope
            End If
            Dim mgmtPath As System.Management.ManagementPath = New System.Management.ManagementPath(CreatedClassName)
            Dim tmpMgmtClass As System.Management.ManagementClass = New System.Management.ManagementClass(mgmtScope, mgmtPath, Nothing)
            Return New OperatingSystem0(tmpMgmtClass.CreateInstance)
        End Function

        <Browsable(True)> _
        Public Sub Delete()
            PrivateLateBoundObject.Delete()
        End Sub

        Public Function Reboot() As UInteger
            If (isEmbedded = False) Then
                Dim inParams As System.Management.ManagementBaseObject = Nothing
                Dim EnablePrivileges As Boolean = PrivateLateBoundObject.Scope.Options.EnablePrivileges
                PrivateLateBoundObject.Scope.Options.EnablePrivileges = True
                Dim outParams As System.Management.ManagementBaseObject = PrivateLateBoundObject.InvokeMethod("Reboot", inParams, Nothing)
                PrivateLateBoundObject.Scope.Options.EnablePrivileges = EnablePrivileges
                Return System.Convert.ToUInt32(outParams.Properties("ReturnValue").Value)
            Else
                Return System.Convert.ToUInt32(0)
            End If
        End Function

        Public Function SetDateTime(ByVal LocalDateTime As Date) As UInteger
            If (isEmbedded = False) Then
                Dim inParams As System.Management.ManagementBaseObject = Nothing
                Dim EnablePrivileges As Boolean = PrivateLateBoundObject.Scope.Options.EnablePrivileges
                PrivateLateBoundObject.Scope.Options.EnablePrivileges = True
                inParams = PrivateLateBoundObject.GetMethodParameters("SetDateTime")
                inParams("LocalDateTime") = ToDmtfDateTime(CType(LocalDateTime, Date))
                Dim outParams As System.Management.ManagementBaseObject = PrivateLateBoundObject.InvokeMethod("SetDateTime", inParams, Nothing)
                PrivateLateBoundObject.Scope.Options.EnablePrivileges = EnablePrivileges
                Return System.Convert.ToUInt32(outParams.Properties("ReturnValue").Value)
            Else
                Return System.Convert.ToUInt32(0)
            End If
        End Function

        Public Function Shutdown() As UInteger
            If (isEmbedded = False) Then
                Dim inParams As System.Management.ManagementBaseObject = Nothing
                Dim EnablePrivileges As Boolean = PrivateLateBoundObject.Scope.Options.EnablePrivileges
                PrivateLateBoundObject.Scope.Options.EnablePrivileges = True
                Dim outParams As System.Management.ManagementBaseObject = PrivateLateBoundObject.InvokeMethod("Shutdown", inParams, Nothing)
                PrivateLateBoundObject.Scope.Options.EnablePrivileges = EnablePrivileges
                Return System.Convert.ToUInt32(outParams.Properties("ReturnValue").Value)
            Else
                Return System.Convert.ToUInt32(0)
            End If
        End Function

        Public Function Win32Shutdown(ByVal Flags As Integer, ByVal Reserved As Integer) As UInteger
            If (isEmbedded = False) Then
                Dim inParams As System.Management.ManagementBaseObject = Nothing
                Dim EnablePrivileges As Boolean = PrivateLateBoundObject.Scope.Options.EnablePrivileges
                PrivateLateBoundObject.Scope.Options.EnablePrivileges = True
                inParams = PrivateLateBoundObject.GetMethodParameters("Win32Shutdown")
                inParams("Flags") = CType(Flags, System.Int32)
                inParams("Reserved") = CType(Reserved, System.Int32)
                Dim outParams As System.Management.ManagementBaseObject = PrivateLateBoundObject.InvokeMethod("Win32Shutdown", inParams, Nothing)
                PrivateLateBoundObject.Scope.Options.EnablePrivileges = EnablePrivileges
                Return System.Convert.ToUInt32(outParams.Properties("ReturnValue").Value)
            Else
                Return System.Convert.ToUInt32(0)
            End If
        End Function

        Public Function Win32ShutdownTracker(ByVal Comment As String, ByVal Flags As Integer, ByVal ReasonCode As UInteger, ByVal Timeout As UInteger) As UInteger
            If (isEmbedded = False) Then
                Dim inParams As System.Management.ManagementBaseObject = Nothing
                Dim EnablePrivileges As Boolean = PrivateLateBoundObject.Scope.Options.EnablePrivileges
                PrivateLateBoundObject.Scope.Options.EnablePrivileges = True
                inParams = PrivateLateBoundObject.GetMethodParameters("Win32ShutdownTracker")
                inParams("Comment") = CType(Comment, System.String)
                inParams("Flags") = CType(Flags, System.Int32)
                inParams("ReasonCode") = CType(ReasonCode, System.UInt32)
                inParams("Timeout") = CType(Timeout, System.UInt32)
                Dim outParams As System.Management.ManagementBaseObject = PrivateLateBoundObject.InvokeMethod("Win32ShutdownTracker", inParams, Nothing)
                PrivateLateBoundObject.Scope.Options.EnablePrivileges = EnablePrivileges
                Return System.Convert.ToUInt32(outParams.Properties("ReturnValue").Value)
            Else
                Return System.Convert.ToUInt32(0)
            End If
        End Function

        Public Enum DataExecutionPrevention_SupportPolicyValues

            Always_Off = 0

            Always_On = 1

            Opt_In = 2

            Opt_Out = 3

            NULL_ENUM_VALUE = 4
        End Enum

        Public Enum EncryptionLevelValues

            Val_40_bit = 0

            Val_128_bit = 1

            N_bit = 2

            NULL_ENUM_VALUE = 3
        End Enum

        Public Enum ForegroundApplicationBoostValues

            None = 0

            Minimum = 1

            Maximum = 2

            NULL_ENUM_VALUE = 3
        End Enum

        Public Enum LargeSystemCacheValues

            Optimize_for_Applications = 0

            Optimize_for_System_Performance = 1

            NULL_ENUM_VALUE = 2
        End Enum

        Public Enum OSProductSuiteValues

            Small_Business = 1

            Enterprise = 2

            BackOffice = 4

            Communication_Server = 8

            Terminal_Server = 16

            Small_Business_Restricted_ = 32

            Embedded_NT = 64

            Data_Center = 128

            NULL_ENUM_VALUE = 256
        End Enum

        Public Enum OSTypeValues

            Unknown0 = 0

            Other0 = 1

            MACOS = 2

            ATTUNIX = 3

            DGUX = 4

            DECNT = 5

            Digital_Unix = 6

            OpenVMS = 7

            HPUX = 8

            AIX = 9

            MVS = 10

            OS400 = 11

            OS_2 = 12

            JavaVM = 13

            MSDOS = 14

            WIN3x = 15

            WIN95 = 16

            WIN98 = 17

            WINNT = 18

            WINCE = 19

            NCR3000 = 20

            NetWare = 21

            OSF = 22

            DC_OS = 23

            Reliant_UNIX = 24

            SCO_UnixWare = 25

            SCO_OpenServer = 26

            Sequent = 27

            IRIX = 28

            Solaris = 29

            SunOS = 30

            U6000 = 31

            ASERIES = 32

            TandemNSK = 33

            TandemNT = 34

            BS2000 = 35

            LINUX = 36

            Lynx = 37

            XENIX = 38

            VM_ESA = 39

            Interactive_UNIX = 40

            BSDUNIX = 41

            FreeBSD = 42

            NetBSD = 43

            GNU_Hurd = 44

            OS9 = 45

            MACH_Kernel = 46

            Inferno = 47

            QNX = 48

            EPOC = 49

            IxWorks = 50

            VxWorks = 51

            MiNT = 52

            BeOS = 53

            HP_MPE = 54

            NextStep = 55

            PalmPilot = 56

            Rhapsody = 57

            Windows_2000 = 58

            Dedicated = 59

            OS_390 = 60

            VSE = 61

            TPF = 62

            NULL_ENUM_VALUE = 63
        End Enum

        Public Enum ProductTypeValues

            Work_Station = 1

            Domain_Controller = 2

            Server = 3

            NULL_ENUM_VALUE = 0
        End Enum

        Public Enum QuantumLengthValues

            Unknown0 = 0

            One_tick = 1

            Two_ticks = 2

            NULL_ENUM_VALUE = 3
        End Enum

        Public Enum QuantumTypeValues

            Unknown0 = 0

            Fixed = 1

            Variable = 2

            NULL_ENUM_VALUE = 3
        End Enum

        Public Enum SuiteMaskValues

            Windows_Server_2003_Small_Business_Edition = 0

            Windows_Server_2003_Enterprise_Edition = 1

            Windows_Server_2003_Backoffice_Edition = 2

            Windows_Server_2003_Communications_Edition = 3

            Microsoft_Terminal_Services = 4

            Windows_Server_2003_Small_Business_Edition_Restricted = 5

            Windows_XP_Embedded = 6

            Windows_Server_2003_Datacenter_Edition = 7

            Single_User = 8

            Windows_XP_Home_Edition = 9

            Windows_Server_2003_Web_Edition = 10

            NULL_ENUM_VALUE = 20
        End Enum

        'TypeConverter to handle null values for ValueType properties
        Public Class WMIValueTypeConverter
            Inherits TypeConverter

            Private baseConverter As TypeConverter

            Private baseType As System.Type

            Public Sub New(ByVal inBaseType As System.Type)
                MyBase.New()
                baseConverter = TypeDescriptor.GetConverter(inBaseType)
                baseType = inBaseType
            End Sub

            Public Overloads Overrides Function CanConvertFrom(ByVal context As System.ComponentModel.ITypeDescriptorContext, ByVal srcType As System.Type) As Boolean
                Return baseConverter.CanConvertFrom(context, srcType)
            End Function

            Public Overloads Overrides Function CanConvertTo(ByVal context As System.ComponentModel.ITypeDescriptorContext, ByVal destinationType As System.Type) As Boolean
                Return baseConverter.CanConvertTo(context, destinationType)
            End Function

            Public Overloads Overrides Function ConvertFrom(ByVal context As System.ComponentModel.ITypeDescriptorContext, ByVal culture As System.Globalization.CultureInfo, ByVal value As Object) As Object
                Return baseConverter.ConvertFrom(context, culture, value)
            End Function

            Public Overloads Overrides Function CreateInstance(ByVal context As System.ComponentModel.ITypeDescriptorContext, ByVal dictionary As System.Collections.IDictionary) As Object
                Return baseConverter.CreateInstance(context, dictionary)
            End Function

            Public Overloads Overrides Function GetCreateInstanceSupported(ByVal context As System.ComponentModel.ITypeDescriptorContext) As Boolean
                Return baseConverter.GetCreateInstanceSupported(context)
            End Function

            Public Overloads Overrides Function GetProperties(ByVal context As System.ComponentModel.ITypeDescriptorContext, ByVal value As Object, ByVal attributeVar() As System.Attribute) As PropertyDescriptorCollection
                Return baseConverter.GetProperties(context, value, attributeVar)
            End Function

            Public Overloads Overrides Function GetPropertiesSupported(ByVal context As System.ComponentModel.ITypeDescriptorContext) As Boolean
                Return baseConverter.GetPropertiesSupported(context)
            End Function

            Public Overloads Overrides Function GetStandardValues(ByVal context As System.ComponentModel.ITypeDescriptorContext) As System.ComponentModel.TypeConverter.StandardValuesCollection
                Return baseConverter.GetStandardValues(context)
            End Function

            Public Overloads Overrides Function GetStandardValuesExclusive(ByVal context As System.ComponentModel.ITypeDescriptorContext) As Boolean
                Return baseConverter.GetStandardValuesExclusive(context)
            End Function

            Public Overloads Overrides Function GetStandardValuesSupported(ByVal context As System.ComponentModel.ITypeDescriptorContext) As Boolean
                Return baseConverter.GetStandardValuesSupported(context)
            End Function

            Public Overloads Overrides Function ConvertTo(ByVal context As System.ComponentModel.ITypeDescriptorContext, ByVal culture As System.Globalization.CultureInfo, ByVal value As Object, ByVal destinationType As System.Type) As Object
                If (baseType.BaseType Is GetType(System.[Enum])) Then
                    If (value.GetType Is destinationType) Then
                        Return value
                    End If
                    If (((value = Nothing) _
                                AndAlso (Not (context) Is Nothing)) _
                                AndAlso (context.PropertyDescriptor.ShouldSerializeValue(context.Instance) = False)) Then
                        Return "NULL_ENUM_VALUE"
                    End If
                    Return baseConverter.ConvertTo(context, culture, value, destinationType)
                End If
                If ((baseType Is GetType(Boolean)) _
                            AndAlso (baseType.BaseType Is GetType(System.ValueType))) Then
                    If (((value = Nothing) _
                                AndAlso (Not (context) Is Nothing)) _
                                AndAlso (context.PropertyDescriptor.ShouldSerializeValue(context.Instance) = False)) Then
                        Return ""
                    End If
                    Return baseConverter.ConvertTo(context, culture, value, destinationType)
                End If
                If ((Not (context) Is Nothing) _
                            AndAlso (context.PropertyDescriptor.ShouldSerializeValue(context.Instance) = False)) Then
                    Return ""
                End If
                Return baseConverter.ConvertTo(context, culture, value, destinationType)
            End Function
        End Class

        'Embedded class to represent WMI system Properties.
        <TypeConverter(GetType(System.ComponentModel.ExpandableObjectConverter))> _
        Public Class ManagementSystemProperties

            Private PrivateLateBoundObject As System.Management.ManagementBaseObject

            Public Sub New(ByVal ManagedObject As System.Management.ManagementBaseObject)
                MyBase.New()
                PrivateLateBoundObject = ManagedObject
            End Sub

            <Browsable(True)> _
            Public ReadOnly Property GENUS() As Integer
                Get
                    Return CType(PrivateLateBoundObject("__GENUS"), Integer)
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property [CLASS]() As String
                Get
                    Return CType(PrivateLateBoundObject("__CLASS"), String)
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property SUPERCLASS() As String
                Get
                    Return CType(PrivateLateBoundObject("__SUPERCLASS"), String)
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property DYNASTY() As String
                Get
                    Return CType(PrivateLateBoundObject("__DYNASTY"), String)
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property RELPATH() As String
                Get
                    Return CType(PrivateLateBoundObject("__RELPATH"), String)
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property PROPERTY_COUNT() As Integer
                Get
                    Return CType(PrivateLateBoundObject("__PROPERTY_COUNT"), Integer)
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property DERIVATION() As String()
                Get
                    Return CType(PrivateLateBoundObject("__DERIVATION"), String())
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property SERVER() As String
                Get
                    Return CType(PrivateLateBoundObject("__SERVER"), String)
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property [NAMESPACE]() As String
                Get
                    Return CType(PrivateLateBoundObject("__NAMESPACE"), String)
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property PATH() As String
                Get
                    Return CType(PrivateLateBoundObject("__PATH"), String)
                End Get
            End Property
        End Class
    End Class

    'Functions ShouldSerialize<PropertyName> are functions used by VS property browser to check if a particular property has to be serialized. These functions are added for all ValueType properties ( properties of type Int32, BOOL etc.. which cannot be set to null). These functions use Is<PropertyName>Null function. These functions are also used in the TypeConverter implementation for the properties to check for NULL value of property so that an empty value can be shown in Property browser in case of Drag and Drop in Visual studio.
    'Functions Is<PropertyName>Null() are used to check if a property is NULL.
    'Functions Reset<PropertyName> are added for Nullable Read/Write properties. These functions are used by VS designer in property browser to set a property to NULL.
    'Every property added to the class for WMI property has attributes set to define its behavior in Visual Studio designer and also to define a TypeConverter to be used.
    'Datetime conversion functions ToDateTime and ToDmtfDateTime are added to the class to convert DMTF datetime to System.DateTime and vice-versa.
    'An Early Bound class generated for the WMI class.Win32_DiskPartition
    Public Class DiskPartition
        Inherits System.ComponentModel.Component

        'Private property to hold the WMI namespace in which the class resides.
        Private Shared CreatedWmiNamespace As String = "root\cimv2"

        'Private property to hold the name of WMI class which created this class.
        Private Shared CreatedClassName As String = "Win32_DiskPartition"

        'Private member variable to hold the ManagementScope which is used by the various methods.
        Private Shared statMgmtScope As System.Management.ManagementScope = Nothing

        Private PrivateSystemProperties As ManagementSystemProperties

        'Underlying lateBound WMI object.
        Private PrivateLateBoundObject As System.Management.ManagementObject

        'Member variable to store the 'automatic commit' behavior for the class.
        Private AutoCommitProp As Boolean

        'Private variable to hold the embedded property representing the instance.
        Private embeddedObj As System.Management.ManagementBaseObject

        'The current WMI object used
        Private curObj As System.Management.ManagementBaseObject

        'Flag to indicate if the instance is an embedded object.
        Private isEmbedded As Boolean

        'Below are different overloads of constructors to initialize an instance of the class with a WMI object.
        Public Sub New()
            MyBase.New()
            Me.InitializeObject(Nothing, Nothing, Nothing)
        End Sub

        Public Sub New(ByVal keyDeviceID As String)
            MyBase.New()
            Me.InitializeObject(Nothing, New System.Management.ManagementPath(DiskPartition.ConstructPath(keyDeviceID)), Nothing)
        End Sub

        Public Sub New(ByVal mgmtScope As System.Management.ManagementScope, ByVal keyDeviceID As String)
            MyBase.New()
            Me.InitializeObject(CType(mgmtScope, System.Management.ManagementScope), New System.Management.ManagementPath(DiskPartition.ConstructPath(keyDeviceID)), Nothing)
        End Sub

        Public Sub New(ByVal path As System.Management.ManagementPath, ByVal getOptions As System.Management.ObjectGetOptions)
            MyBase.New()
            Me.InitializeObject(Nothing, path, getOptions)
        End Sub

        Public Sub New(ByVal mgmtScope As System.Management.ManagementScope, ByVal path As System.Management.ManagementPath)
            MyBase.New()
            Me.InitializeObject(mgmtScope, path, Nothing)
        End Sub

        Public Sub New(ByVal path As System.Management.ManagementPath)
            MyBase.New()
            Me.InitializeObject(Nothing, path, Nothing)
        End Sub

        Public Sub New(ByVal mgmtScope As System.Management.ManagementScope, ByVal path As System.Management.ManagementPath, ByVal getOptions As System.Management.ObjectGetOptions)
            MyBase.New()
            Me.InitializeObject(mgmtScope, path, getOptions)
        End Sub

        Public Sub New(ByVal theObject As System.Management.ManagementObject)
            MyBase.New()
            Initialize()
            If (CheckIfProperClass(theObject) = True) Then
                PrivateLateBoundObject = theObject
                PrivateSystemProperties = New ManagementSystemProperties(PrivateLateBoundObject)
                curObj = PrivateLateBoundObject
            Else
                Throw New System.ArgumentException("Class name does not match.")
            End If
        End Sub

        Public Sub New(ByVal theObject As System.Management.ManagementBaseObject)
            MyBase.New()
            Initialize()
            If (CheckIfProperClass(theObject) = True) Then
                embeddedObj = theObject
                PrivateSystemProperties = New ManagementSystemProperties(theObject)
                curObj = embeddedObj
                isEmbedded = True
            Else
                Throw New System.ArgumentException("Class name does not match.")
            End If
        End Sub

        'Property returns the namespace of the WMI class.
        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property OriginatingNamespace() As String
            Get
                Return "root\cimv2"
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property ManagementClassName() As String
            Get
                Dim strRet As String = CreatedClassName
                If (Not (curObj) Is Nothing) Then
                    If (Not (curObj.ClassPath) Is Nothing) Then
                        strRet = CType(curObj("__CLASS"), String)
                        If ((strRet Is Nothing) _
                                    OrElse (strRet Is String.Empty)) Then
                            strRet = CreatedClassName
                        End If
                    End If
                End If
                Return strRet
            End Get
        End Property

        'Property pointing to an embedded object to get System properties of the WMI object.
        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property SystemProperties() As ManagementSystemProperties
            Get
                Return PrivateSystemProperties
            End Get
        End Property

        'Property returning the underlying lateBound object.
        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property LateBoundObject() As System.Management.ManagementBaseObject
            Get
                Return curObj
            End Get
        End Property

        'ManagementScope of the object.
        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public Property Scope() As System.Management.ManagementScope
            Get
                If (isEmbedded = False) Then
                    Return PrivateLateBoundObject.Scope
                Else
                    Return Nothing
                End If
            End Get
            Set(ByVal value As System.Management.ManagementScope)
                If (isEmbedded = False) Then
                    PrivateLateBoundObject.Scope = value
                End If
            End Set
        End Property

        'Property to show the commit behavior for the WMI object. If true, WMI object will be automatically saved after each property modification.(ie. Put() is called after modification of a property).
        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public Property AutoCommit() As Boolean
            Get
                Return AutoCommitProp
            End Get
            Set(ByVal value As Boolean)
                AutoCommitProp = value
            End Set
        End Property

        'The ManagementPath of the underlying WMI object.
        <Browsable(True)> _
        Public Property Path() As System.Management.ManagementPath
            Get
                If (isEmbedded = False) Then
                    Return PrivateLateBoundObject.Path
                Else
                    Return Nothing
                End If
            End Get
            Set(ByVal value As System.Management.ManagementPath)
                If (isEmbedded = False) Then
                    If (CheckIfProperClass(Nothing, value, Nothing) <> True) Then
                        Throw New System.ArgumentException("Class name does not match.")
                    End If
                    PrivateLateBoundObject.Path = value
                End If
            End Set
        End Property

        'Public static scope property which is used by the various methods.
        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public Shared Property StaticScope() As System.Management.ManagementScope
            Get
                Return statMgmtScope
            End Get
            Set(ByVal value As System.Management.ManagementScope)
                statMgmtScope = value
            End Set
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsAccessNull() As Boolean
            Get
                If (curObj("Access") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("Access describes whether the media is readable (value=1), writeable (value=2), or" & _
            " both (value=3). ""Unknown"" (0) and ""Write Once"" (4) can also be defined."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property Access() As AccessValues
            Get
                If (curObj("Access") Is Nothing) Then
                    Return CType(System.Convert.ToInt32(5), AccessValues)
                End If
                Return CType(System.Convert.ToInt32(curObj("Access")), AccessValues)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsAvailabilityNull() As Boolean
            Get
                If (curObj("Availability") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The availability and status of the device.  For example, the Availability propert" & _
            "y indicates that the device is running and has full power (value=3), or is in a " & _
            "warning (4), test (5), degraded (10) or power save state (values 13-15 and 17). " & _
            "Regarding the power saving states, these are defined as follows: Value 13 (""Powe" & _
            "r Save - Unknown"") indicates that the device is known to be in a power save mode" & _
            ", but its exact status in this mode is unknown; 14 (""Power Save - Low Power Mode" & _
            """) indicates that the device is in a power save state but still functioning, and" & _
            " may exhibit degraded performance; 15 (""Power Save - Standby"") describes that th" & _
            "e device is not functioning but could be brought to full power 'quickly'; and va" & _
            "lue 17 (""Power Save - Warning"") indicates that the device is in a warning state," & _
            " though also in a power save mode."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property Availability() As AvailabilityValues
            Get
                If (curObj("Availability") Is Nothing) Then
                    Return CType(System.Convert.ToInt32(0), AvailabilityValues)
                End If
                Return CType(System.Convert.ToInt32(curObj("Availability")), AvailabilityValues)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsBlockSizeNull() As Boolean
            Get
                If (curObj("BlockSize") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("Size in bytes of the blocks which form this StorageExtent. If variable block size" & _
            ", then the maximum block size in bytes should be specified. If the block size is" & _
            " unknown or if a block concept is not valid (for example, for Aggregate Extents," & _
            " Memory or LogicalDisks), enter a 1."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property BlockSize() As ULong
            Get
                If (curObj("BlockSize") Is Nothing) Then
                    Return System.Convert.ToUInt64(0)
                End If
                Return CType(curObj("BlockSize"), ULong)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsBootableNull() As Boolean
            Get
                If (curObj("Bootable") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("Boolean indicating that the DiskPartition is labelled as bootable. This does not " & _
            "mean that an OperatingSystem is actually loaded on the partition."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property Bootable() As Boolean
            Get
                If (curObj("Bootable") Is Nothing) Then
                    Return System.Convert.ToBoolean(0)
                End If
                Return CType(curObj("Bootable"), Boolean)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsBootPartitionNull() As Boolean
            Get
                If (curObj("BootPartition") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The BootPartition property determines whether the partition is the active partiti" & _
            "on. The operating system uses the active partition when booting from a hard disk" & _
            "." & Global.Microsoft.VisualBasic.ChrW(10) & "Values: TRUE or FALSE. If TRUE, the partition is active."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property BootPartition() As Boolean
            Get
                If (curObj("BootPartition") Is Nothing) Then
                    Return System.Convert.ToBoolean(0)
                End If
                Return CType(curObj("BootPartition"), Boolean)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The Caption property is a short textual description (one-line string) of the obje" & _
            "ct.")> _
        Public ReadOnly Property Caption() As String
            Get
                Return CType(curObj("Caption"), String)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsConfigManagerErrorCodeNull() As Boolean
            Get
                If (curObj("ConfigManagerErrorCode") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("Indicates the Win32 Configuration Manager error code.  The following values may b" & _
            "e returned: " & Global.Microsoft.VisualBasic.ChrW(10) & "0      This device is working properly. " & Global.Microsoft.VisualBasic.ChrW(10) & "1      This device is not " & _
            "configured correctly. " & Global.Microsoft.VisualBasic.ChrW(10) & "2      Windows cannot load the driver for this device. " & Global.Microsoft.VisualBasic.ChrW(10) & "3" & _
            "      The driver for this device might be corrupted, or your system may be runni" & _
            "ng low on memory or other resources. " & Global.Microsoft.VisualBasic.ChrW(10) & "4      This device is not working properly" & _
            ". One of its drivers or your registry might be corrupted. " & Global.Microsoft.VisualBasic.ChrW(10) & "5      The driver for" & _
            " this device needs a resource that Windows cannot manage. " & Global.Microsoft.VisualBasic.ChrW(10) & "6      The boot confi" & _
            "guration for this device conflicts with other devices. " & Global.Microsoft.VisualBasic.ChrW(10) & "7      Cannot filter. " & Global.Microsoft.VisualBasic.ChrW(10) & "8" & _
            "      The driver loader for the device is missing. " & Global.Microsoft.VisualBasic.ChrW(10) & "9      This device is not wo" & _
            "rking properly because the controlling firmware is reporting the resources for t" & _
            "he device incorrectly. " & Global.Microsoft.VisualBasic.ChrW(10) & "10     This device cannot start. " & Global.Microsoft.VisualBasic.ChrW(10) & "11     This device fai" & _
            "led. " & Global.Microsoft.VisualBasic.ChrW(10) & "12     This device cannot find enough free resources that it can use. " & Global.Microsoft.VisualBasic.ChrW(10) & "13 " & _
            "    Windows cannot verify this device's resources. " & Global.Microsoft.VisualBasic.ChrW(10) & "14     This device cannot wo" & _
            "rk properly until you restart your computer. " & Global.Microsoft.VisualBasic.ChrW(10) & "15     This device is not working " & _
            "properly because there is probably a re-enumeration problem. " & Global.Microsoft.VisualBasic.ChrW(10) & "16     Windows can" & _
            "not identify all the resources this device uses. " & Global.Microsoft.VisualBasic.ChrW(10) & "17     This device is asking f" & _
            "or an unknown resource type. " & Global.Microsoft.VisualBasic.ChrW(10) & "18     Reinstall the drivers for this device. " & Global.Microsoft.VisualBasic.ChrW(10) & "19 " & _
            "    Your registry might be corrupted. " & Global.Microsoft.VisualBasic.ChrW(10) & "20     Failure using the VxD loader. " & Global.Microsoft.VisualBasic.ChrW(10) & "21 " & _
            "    System failure: Try changing the driver for this device. If that does not wo" & _
            "rk, see your hardware documentation. Windows is removing this device. " & Global.Microsoft.VisualBasic.ChrW(10) & "22     Th" & _
            "is device is disabled. " & Global.Microsoft.VisualBasic.ChrW(10) & "23     System failure: Try changing the driver for this " & _
            "device. If that doesn't work, see your hardware documentation. " & Global.Microsoft.VisualBasic.ChrW(10) & "24     This devi" & _
            "ce is not present, is not working properly, or does not have all its drivers ins" & _
            "talled. " & Global.Microsoft.VisualBasic.ChrW(10) & "25     Windows is still setting up this device. " & Global.Microsoft.VisualBasic.ChrW(10) & "26     Windows is stil" & _
            "l setting up this device. " & Global.Microsoft.VisualBasic.ChrW(10) & "27     This device does not have valid log configurat" & _
            "ion. " & Global.Microsoft.VisualBasic.ChrW(10) & "28     The drivers for this device are not installed. " & Global.Microsoft.VisualBasic.ChrW(10) & "29     This device " & _
            "is disabled because the firmware of the device did not give it the required reso" & _
            "urces. " & Global.Microsoft.VisualBasic.ChrW(10) & "30     This device is using an Interrupt Request (IRQ) resource that ano" & _
            "ther device is using. " & Global.Microsoft.VisualBasic.ChrW(10) & "31     This device is not working properly because Window" & _
            "s cannot load the drivers required for this device."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property ConfigManagerErrorCode() As ConfigManagerErrorCodeValues
            Get
                If (curObj("ConfigManagerErrorCode") Is Nothing) Then
                    Return CType(System.Convert.ToInt32(32), ConfigManagerErrorCodeValues)
                End If
                Return CType(System.Convert.ToInt32(curObj("ConfigManagerErrorCode")), ConfigManagerErrorCodeValues)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsConfigManagerUserConfigNull() As Boolean
            Get
                If (curObj("ConfigManagerUserConfig") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("Indicates whether the device is using a user-defined configuration."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property ConfigManagerUserConfig() As Boolean
            Get
                If (curObj("ConfigManagerUserConfig") Is Nothing) Then
                    Return System.Convert.ToBoolean(0)
                End If
                Return CType(curObj("ConfigManagerUserConfig"), Boolean)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("CreationClassName indicates the name of the class or the subclass used in the cre" & _
            "ation of an instance. When used with the other key properties of this class, thi" & _
            "s property allows all instances of this class and its subclasses to be uniquely " & _
            "identified.")> _
        Public ReadOnly Property CreationClassName() As String
            Get
                Return CType(curObj("CreationClassName"), String)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The Description property provides a textual description of the object. ")> _
        Public ReadOnly Property Description() As String
            Get
                Return CType(curObj("Description"), String)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The DeviceID property contains a string that uniquely identifies the disk drive a" & _
            "nd partition from the rest of the system")> _
        Public ReadOnly Property DeviceID() As String
            Get
                Return CType(curObj("DeviceID"), String)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsDiskIndexNull() As Boolean
            Get
                If (curObj("DiskIndex") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The DiskIndex property indicates the index number of the disk containing this par" & _
            "tition." & Global.Microsoft.VisualBasic.ChrW(10) & "Example: 0."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property DiskIndex() As UInteger
            Get
                If (curObj("DiskIndex") Is Nothing) Then
                    Return System.Convert.ToUInt32(0)
                End If
                Return CType(curObj("DiskIndex"), UInteger)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsErrorClearedNull() As Boolean
            Get
                If (curObj("ErrorCleared") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("ErrorCleared is a boolean property indicating that the error reported in LastErro" & _
            "rCode property is now cleared."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property ErrorCleared() As Boolean
            Get
                If (curObj("ErrorCleared") Is Nothing) Then
                    Return System.Convert.ToBoolean(0)
                End If
                Return CType(curObj("ErrorCleared"), Boolean)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("ErrorDescription is a free-form string supplying more information about the error" & _
            " recorded in LastErrorCode property, and information on any corrective actions t" & _
            "hat may be taken.")> _
        Public ReadOnly Property ErrorDescription() As String
            Get
                Return CType(curObj("ErrorDescription"), String)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("ErrorMethodology is a free-form string describing the type of error detection and" & _
            " correction supported by this storage extent.")> _
        Public ReadOnly Property ErrorMethodology() As String
            Get
                Return CType(curObj("ErrorMethodology"), String)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsHiddenSectorsNull() As Boolean
            Get
                If (curObj("HiddenSectors") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The HiddenSectors property indicates the number of hidden sectors in the partitio" & _
            "n." & Global.Microsoft.VisualBasic.ChrW(10) & "Example: 63"), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property HiddenSectors() As UInteger
            Get
                If (curObj("HiddenSectors") Is Nothing) Then
                    Return System.Convert.ToUInt32(0)
                End If
                Return CType(curObj("HiddenSectors"), UInteger)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsIndexNull() As Boolean
            Get
                If (curObj("Index") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The Index property indicates the index number of the partition." & Global.Microsoft.VisualBasic.ChrW(10) & "Example: 1"), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property Index() As UInteger
            Get
                If (curObj("Index") Is Nothing) Then
                    Return System.Convert.ToUInt32(0)
                End If
                Return CType(curObj("Index"), UInteger)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsInstallDateNull() As Boolean
            Get
                If (curObj("InstallDate") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The InstallDate property is datetime value indicating when the object was install" & _
            "ed. A lack of a value does not indicate that the object is not installed."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property InstallDate() As Date
            Get
                If (Not (curObj("InstallDate")) Is Nothing) Then
                    Return ToDateTime(CType(curObj("InstallDate"), String))
                Else
                    Return Date.MinValue
                End If
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsLastErrorCodeNull() As Boolean
            Get
                If (curObj("LastErrorCode") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("LastErrorCode captures the last error code reported by the logical device."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property LastErrorCode() As UInteger
            Get
                If (curObj("LastErrorCode") Is Nothing) Then
                    Return System.Convert.ToUInt32(0)
                End If
                Return CType(curObj("LastErrorCode"), UInteger)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The Name property defines the label by which the object is known. When subclassed" & _
            ", the Name property can be overridden to be a Key property.")> _
        Public ReadOnly Property Name() As String
            Get
                Return CType(curObj("Name"), String)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsNumberOfBlocksNull() As Boolean
            Get
                If (curObj("NumberOfBlocks") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("Total number of consecutive blocks, each block the size of the value contained in" & _
            " the BlockSize property, which form this storage extent. Total size of the stora" & _
            "ge extent can be calculated by multiplying the value of the BlockSize property b" & _
            "y the value of this property. If the value of BlockSize is 1, this property is t" & _
            "he total size of the storage extent."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property NumberOfBlocks() As ULong
            Get
                If (curObj("NumberOfBlocks") Is Nothing) Then
                    Return System.Convert.ToUInt64(0)
                End If
                Return CType(curObj("NumberOfBlocks"), ULong)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("Indicates the Win32 Plug and Play device ID of the logical device.  Example: *PNP" & _
            "030b")> _
        Public ReadOnly Property PNPDeviceID() As String
            Get
                Return CType(curObj("PNPDeviceID"), String)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("Indicates the specific power-related capabilities of the logical device. The arra" & _
            "y values, 0=""Unknown"", 1=""Not Supported"" and 2=""Disabled"" are self-explanatory. " & _
            "The value, 3=""Enabled"" indicates that the power management features are currentl" & _
            "y enabled but the exact feature set is unknown or the information is unavailable" & _
            ". ""Power Saving Modes Entered Automatically"" (4) describes that a device can cha" & _
            "nge its power state based on usage or other criteria. ""Power State Settable"" (5)" & _
            " indicates that the SetPowerState method is supported. ""Power Cycling Supported""" & _
            " (6) indicates that the SetPowerState method can be invoked with the PowerState " & _
            "input variable set to 5 (""Power Cycle""). ""Timed Power On Supported"" (7) indicate" & _
            "s that the SetPowerState method can be invoked with the PowerState input variabl" & _
            "e set to 5 (""Power Cycle"") and the Time parameter set to a specific date and tim" & _
            "e, or interval, for power-on.")> _
        Public ReadOnly Property PowerManagementCapabilities() As PowerManagementCapabilitiesValues()
            Get
                Dim arrEnumVals As System.Array = CType(curObj("PowerManagementCapabilities"), System.Array)
                Dim enumToRet((arrEnumVals.Length) - 1) As PowerManagementCapabilitiesValues
                Dim counter As Integer = 0
                counter = 0
                Do While (counter < arrEnumVals.Length)
                    enumToRet(counter) = CType(System.Convert.ToInt32(arrEnumVals.GetValue(counter)), PowerManagementCapabilitiesValues)
                    counter = (counter + 1)
                Loop
                Return enumToRet
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsPowerManagementSupportedNull() As Boolean
            Get
                If (curObj("PowerManagementSupported") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("Boolean indicating that the Device can be power managed - ie, put into a power sa" & _
            "ve state. This boolean does not indicate that power management features are curr" & _
            "ently enabled, or if enabled, what features are supported. Refer to the PowerMan" & _
            "agementCapabilities array for this information. If this boolean is false, the in" & _
            "teger value 1, for the string, ""Not Supported"", should be the only entry in the " & _
            "PowerManagementCapabilities array."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property PowerManagementSupported() As Boolean
            Get
                If (curObj("PowerManagementSupported") Is Nothing) Then
                    Return System.Convert.ToBoolean(0)
                End If
                Return CType(curObj("PowerManagementSupported"), Boolean)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsPrimaryPartitionNull() As Boolean
            Get
                If (curObj("PrimaryPartition") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("Boolean indicating that the DiskPartition is labelled as the primary partition fo" & _
            "r a ComputerSystem."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property PrimaryPartition() As Boolean
            Get
                If (curObj("PrimaryPartition") Is Nothing) Then
                    Return System.Convert.ToBoolean(0)
                End If
                Return CType(curObj("PrimaryPartition"), Boolean)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("A free form string describing the media and/or its use.")> _
        Public ReadOnly Property Purpose() As String
            Get
                Return CType(curObj("Purpose"), String)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsRewritePartitionNull() As Boolean
            Get
                If (curObj("RewritePartition") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The RewritePartition property specifies whether the partition information has cha" & _
            "nged. When you change a partition (with IOCTL_DISK_SET_DRIVE_LAYOUT), the system" & _
            " uses this property member to determine which partitions have changed and need t" & _
            "heir information rewritten." & Global.Microsoft.VisualBasic.ChrW(10) & "Values: TRUE or FALSE. If TRUE, the partition needs " & _
            "to be rewritten."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property RewritePartition() As Boolean
            Get
                If (curObj("RewritePartition") Is Nothing) Then
                    Return System.Convert.ToBoolean(0)
                End If
                Return CType(curObj("RewritePartition"), Boolean)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsSizeNull() As Boolean
            Get
                If (curObj("Size") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The Size property indicates the total size (in bytes) of the partition." & Global.Microsoft.VisualBasic.ChrW(10) & "Example: " & _
            "1059045376"), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property Size() As ULong
            Get
                If (curObj("Size") Is Nothing) Then
                    Return System.Convert.ToUInt64(0)
                End If
                Return CType(curObj("Size"), ULong)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsStartingOffsetNull() As Boolean
            Get
                If (curObj("StartingOffset") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The StartingOffset property indicates the starting offset (in bytes) of the parti" & _
            "tion." & Global.Microsoft.VisualBasic.ChrW(10) & "Example: 32256"), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property StartingOffset() As ULong
            Get
                If (curObj("StartingOffset") Is Nothing) Then
                    Return System.Convert.ToUInt64(0)
                End If
                Return CType(curObj("StartingOffset"), ULong)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The Status property is a string indicating the current status of the object. Vari" & _
            "ous operational and non-operational statuses can be defined. Operational statuse" & _
            "s are ""OK"", ""Degraded"" and ""Pred Fail"". ""Pred Fail"" indicates that an element ma" & _
            "y be functioning properly but predicting a failure in the near future. An exampl" & _
            "e is a SMART-enabled hard drive. Non-operational statuses can also be specified." & _
            " These are ""Error"", ""Starting"", ""Stopping"" and ""Service"". The latter, ""Service""," & _
            " could apply during mirror-resilvering of a disk, reload of a user permissions l" & _
            "ist, or other administrative work. Not all such work is on-line, yet the managed" & _
            " element is neither ""OK"" nor in one of the other states.")> _
        Public ReadOnly Property Status() As String
            Get
                Return CType(curObj("Status"), String)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsStatusInfoNull() As Boolean
            Get
                If (curObj("StatusInfo") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("StatusInfo is a string indicating whether the logical device is in an enabled (va" & _
            "lue = 3), disabled (value = 4) or some other (1) or unknown (2) state. If this p" & _
            "roperty does not apply to the logical device, the value, 5 (""Not Applicable""), s" & _
            "hould be used."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property StatusInfo() As StatusInfoValues
            Get
                If (curObj("StatusInfo") Is Nothing) Then
                    Return CType(System.Convert.ToInt32(0), StatusInfoValues)
                End If
                Return CType(System.Convert.ToInt32(curObj("StatusInfo")), StatusInfoValues)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The scoping System's CreationClassName.")> _
        Public ReadOnly Property SystemCreationClassName() As String
            Get
                Return CType(curObj("SystemCreationClassName"), String)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The scoping System's Name.")> _
        Public ReadOnly Property SystemName() As String
            Get
                Return CType(curObj("SystemName"), String)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The Type property indicates the type of the partition.")> _
        Public ReadOnly Property Type() As String
            Get
                Return CType(curObj("Type"), String)
            End Get
        End Property

        Private Overloads Function CheckIfProperClass(ByVal mgmtScope As System.Management.ManagementScope, ByVal path As System.Management.ManagementPath, ByVal OptionsParam As System.Management.ObjectGetOptions) As Boolean
            If ((Not (path) Is Nothing) _
                        AndAlso (String.Compare(path.ClassName, Me.ManagementClassName, True, System.Globalization.CultureInfo.InvariantCulture) = 0)) Then
                Return True
            Else
                Return CheckIfProperClass(New System.Management.ManagementObject(mgmtScope, path, OptionsParam))
            End If
        End Function

        Private Overloads Function CheckIfProperClass(ByVal theObj As System.Management.ManagementBaseObject) As Boolean
            If ((Not (theObj) Is Nothing) _
                        AndAlso (String.Compare(CType(theObj("__CLASS"), String), Me.ManagementClassName, True, System.Globalization.CultureInfo.InvariantCulture) = 0)) Then
                Return True
            Else
                Dim parentClasses As System.Array = CType(theObj("__DERIVATION"), System.Array)
                If (Not (parentClasses) Is Nothing) Then
                    Dim count As Integer = 0
                    count = 0
                    Do While (count < parentClasses.Length)
                        If (String.Compare(CType(parentClasses.GetValue(count), String), Me.ManagementClassName, True, System.Globalization.CultureInfo.InvariantCulture) = 0) Then
                            Return True
                        End If
                        count = (count + 1)
                    Loop
                End If
            End If
            Return False
        End Function

        Private Function ShouldSerializeAccess() As Boolean
            If (Me.IsAccessNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeAvailability() As Boolean
            If (Me.IsAvailabilityNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeBlockSize() As Boolean
            If (Me.IsBlockSizeNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeBootable() As Boolean
            If (Me.IsBootableNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeBootPartition() As Boolean
            If (Me.IsBootPartitionNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeConfigManagerErrorCode() As Boolean
            If (Me.IsConfigManagerErrorCodeNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeConfigManagerUserConfig() As Boolean
            If (Me.IsConfigManagerUserConfigNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeDiskIndex() As Boolean
            If (Me.IsDiskIndexNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeErrorCleared() As Boolean
            If (Me.IsErrorClearedNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeHiddenSectors() As Boolean
            If (Me.IsHiddenSectorsNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeIndex() As Boolean
            If (Me.IsIndexNull = False) Then
                Return True
            End If
            Return False
        End Function

        'Converts a given datetime in DMTF format to System.DateTime object.
        Shared Function ToDateTime(ByVal dmtfDate As String) As Date
            Dim initializer As Date = Date.MinValue
            Dim year As Integer = initializer.Year
            Dim month As Integer = initializer.Month
            Dim day As Integer = initializer.Day
            Dim hour As Integer = initializer.Hour
            Dim minute As Integer = initializer.Minute
            Dim second As Integer = initializer.Second
            Dim ticks As Long = 0
            Dim dmtf As String = dmtfDate
            Dim datetime As Date = Date.MinValue
            Dim tempString As String = String.Empty
            If (dmtf Is Nothing) Then
                Throw New System.ArgumentOutOfRangeException
            End If
            If (dmtf.Length = 0) Then
                Throw New System.ArgumentOutOfRangeException
            End If
            If (dmtf.Length <> 25) Then
                Throw New System.ArgumentOutOfRangeException
            End If
            Try
                tempString = dmtf.Substring(0, 4)
                If ("****" <> tempString) Then
                    year = Integer.Parse(tempString)
                End If
                tempString = dmtf.Substring(4, 2)
                If ("**" <> tempString) Then
                    month = Integer.Parse(tempString)
                End If
                tempString = dmtf.Substring(6, 2)
                If ("**" <> tempString) Then
                    day = Integer.Parse(tempString)
                End If
                tempString = dmtf.Substring(8, 2)
                If ("**" <> tempString) Then
                    hour = Integer.Parse(tempString)
                End If
                tempString = dmtf.Substring(10, 2)
                If ("**" <> tempString) Then
                    minute = Integer.Parse(tempString)
                End If
                tempString = dmtf.Substring(12, 2)
                If ("**" <> tempString) Then
                    second = Integer.Parse(tempString)
                End If
                tempString = dmtf.Substring(15, 6)
                If ("******" <> tempString) Then
                    ticks = (Long.Parse(tempString) * CType((System.TimeSpan.TicksPerMillisecond / 1000), Long))
                End If
                If ((((((((year < 0) _
                            OrElse (month < 0)) _
                            OrElse (day < 0)) _
                            OrElse (hour < 0)) _
                            OrElse (minute < 0)) _
                            OrElse (minute < 0)) _
                            OrElse (second < 0)) _
                            OrElse (ticks < 0)) Then
                    Throw New System.ArgumentOutOfRangeException
                End If
            Catch e As System.Exception
                Throw New System.ArgumentOutOfRangeException(Nothing, e.Message)
            End Try
            datetime = New Date(year, month, day, hour, minute, second, 0)
            datetime = datetime.AddTicks(ticks)
            Dim tickOffset As System.TimeSpan = System.TimeZone.CurrentTimeZone.GetUtcOffset(datetime)
            Dim UTCOffset As Integer = 0
            Dim OffsetToBeAdjusted As Integer = 0
            Dim OffsetMins As Long = CType((tickOffset.Ticks / System.TimeSpan.TicksPerMinute), Long)
            tempString = dmtf.Substring(22, 3)
            If (tempString <> "******") Then
                tempString = dmtf.Substring(21, 4)
                Try
                    UTCOffset = Integer.Parse(tempString)
                Catch e As System.Exception
                    Throw New System.ArgumentOutOfRangeException(Nothing, e.Message)
                End Try
                OffsetToBeAdjusted = CType((OffsetMins - UTCOffset), Integer)
                datetime = datetime.AddMinutes(CType(OffsetToBeAdjusted, Double))
            End If
            Return datetime
        End Function

        'Converts a given System.DateTime object to DMTF datetime format.
        Shared Function ToDmtfDateTime(ByVal [date] As Date) As String
            Dim utcString As String = String.Empty
            Dim tickOffset As System.TimeSpan = System.TimeZone.CurrentTimeZone.GetUtcOffset([date])
            Dim OffsetMins As Long = CType((tickOffset.Ticks / System.TimeSpan.TicksPerMinute), Long)
            If (System.Math.Abs(OffsetMins) > 999) Then
                [date] = [date].ToUniversalTime
                utcString = "+000"
            Else
                If (tickOffset.Ticks >= 0) Then
                    utcString = String.Concat("+", CType((tickOffset.Ticks / System.TimeSpan.TicksPerMinute), System.Int64).ToString.PadLeft(3, Global.Microsoft.VisualBasic.ChrW(48)))
                Else
                    Dim strTemp As String = CType(OffsetMins, System.Int64).ToString
                    utcString = String.Concat("-", strTemp.Substring(1, (strTemp.Length - 1)).PadLeft(3, Global.Microsoft.VisualBasic.ChrW(48)))
                End If
            End If
            Dim dmtfDateTime As String = CType([date].Year, System.Int32).ToString.PadLeft(4, Global.Microsoft.VisualBasic.ChrW(48))
            dmtfDateTime = String.Concat(dmtfDateTime, CType([date].Month, System.Int32).ToString.PadLeft(2, Global.Microsoft.VisualBasic.ChrW(48)))
            dmtfDateTime = String.Concat(dmtfDateTime, CType([date].Day, System.Int32).ToString.PadLeft(2, Global.Microsoft.VisualBasic.ChrW(48)))
            dmtfDateTime = String.Concat(dmtfDateTime, CType([date].Hour, System.Int32).ToString.PadLeft(2, Global.Microsoft.VisualBasic.ChrW(48)))
            dmtfDateTime = String.Concat(dmtfDateTime, CType([date].Minute, System.Int32).ToString.PadLeft(2, Global.Microsoft.VisualBasic.ChrW(48)))
            dmtfDateTime = String.Concat(dmtfDateTime, CType([date].Second, System.Int32).ToString.PadLeft(2, Global.Microsoft.VisualBasic.ChrW(48)))
            dmtfDateTime = String.Concat(dmtfDateTime, ".")
            Dim dtTemp As Date = New Date([date].Year, [date].Month, [date].Day, [date].Hour, [date].Minute, [date].Second, 0)
            Dim microsec As Long = CType(((([date].Ticks - dtTemp.Ticks) _
                        * 1000) _
                        / System.TimeSpan.TicksPerMillisecond), Long)
            Dim strMicrosec As String = CType(microsec, System.Int64).ToString
            If (strMicrosec.Length > 6) Then
                strMicrosec = strMicrosec.Substring(0, 6)
            End If
            dmtfDateTime = String.Concat(dmtfDateTime, strMicrosec.PadLeft(6, Global.Microsoft.VisualBasic.ChrW(48)))
            dmtfDateTime = String.Concat(dmtfDateTime, utcString)
            Return dmtfDateTime
        End Function

        Private Function ShouldSerializeInstallDate() As Boolean
            If (Me.IsInstallDateNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeLastErrorCode() As Boolean
            If (Me.IsLastErrorCodeNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeNumberOfBlocks() As Boolean
            If (Me.IsNumberOfBlocksNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializePowerManagementSupported() As Boolean
            If (Me.IsPowerManagementSupportedNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializePrimaryPartition() As Boolean
            If (Me.IsPrimaryPartitionNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeRewritePartition() As Boolean
            If (Me.IsRewritePartitionNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeSize() As Boolean
            If (Me.IsSizeNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeStartingOffset() As Boolean
            If (Me.IsStartingOffsetNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeStatusInfo() As Boolean
            If (Me.IsStatusInfoNull = False) Then
                Return True
            End If
            Return False
        End Function

        <Browsable(True)> _
        Public Overloads Sub CommitObject()
            If (isEmbedded = False) Then
                PrivateLateBoundObject.Put()
            End If
        End Sub

        <Browsable(True)> _
        Public Overloads Sub CommitObject(ByVal putOptions As System.Management.PutOptions)
            If (isEmbedded = False) Then
                PrivateLateBoundObject.Put(putOptions)
            End If
        End Sub

        Private Sub Initialize()
            AutoCommitProp = True
            isEmbedded = False
        End Sub

        Private Shared Function ConstructPath(ByVal keyDeviceID As String) As String
            Dim strPath As String = "root\cimv2:Win32_DiskPartition"
            strPath = String.Concat(strPath, String.Concat(".DeviceID=", String.Concat("""", String.Concat(keyDeviceID, """"))))
            Return strPath
        End Function

        Private Sub InitializeObject(ByVal mgmtScope As System.Management.ManagementScope, ByVal path As System.Management.ManagementPath, ByVal getOptions As System.Management.ObjectGetOptions)
            Initialize()
            If (Not (path) Is Nothing) Then
                If (CheckIfProperClass(mgmtScope, path, getOptions) <> True) Then
                    Throw New System.ArgumentException("Class name does not match.")
                End If
            End If
            PrivateLateBoundObject = New System.Management.ManagementObject(mgmtScope, path, getOptions)
            PrivateSystemProperties = New ManagementSystemProperties(PrivateLateBoundObject)
            curObj = PrivateLateBoundObject
        End Sub

        'Different overloads of GetInstances() help in enumerating instances of the WMI class.
        Public Overloads Shared Function GetInstances() As DiskPartitionCollection
            Return GetInstances(Nothing, Nothing, Nothing)
        End Function

        Public Overloads Shared Function GetInstances(ByVal condition As String) As DiskPartitionCollection
            Return GetInstances(Nothing, condition, Nothing)
        End Function

        Public Overloads Shared Function GetInstances(ByVal selectedProperties() As System.String) As DiskPartitionCollection
            Return GetInstances(Nothing, Nothing, selectedProperties)
        End Function

        Public Overloads Shared Function GetInstances(ByVal condition As String, ByVal selectedProperties() As System.String) As DiskPartitionCollection
            Return GetInstances(Nothing, condition, selectedProperties)
        End Function

        Public Overloads Shared Function GetInstances(ByVal mgmtScope As System.Management.ManagementScope, ByVal enumOptions As System.Management.EnumerationOptions) As DiskPartitionCollection
            If (mgmtScope Is Nothing) Then
                If (statMgmtScope Is Nothing) Then
                    mgmtScope = New System.Management.ManagementScope
                    mgmtScope.Path.NamespacePath = "root\cimv2"
                Else
                    mgmtScope = statMgmtScope
                End If
            End If
            Dim pathObj As System.Management.ManagementPath = New System.Management.ManagementPath
            pathObj.ClassName = "Win32_DiskPartition"
            pathObj.NamespacePath = "root\cimv2"
            Dim clsObject As System.Management.ManagementClass = New System.Management.ManagementClass(mgmtScope, pathObj, Nothing)
            If (enumOptions Is Nothing) Then
                enumOptions = New System.Management.EnumerationOptions
                enumOptions.EnsureLocatable = True
            End If
            Return New DiskPartitionCollection(clsObject.GetInstances(enumOptions))
        End Function

        Public Overloads Shared Function GetInstances(ByVal mgmtScope As System.Management.ManagementScope, ByVal condition As String) As DiskPartitionCollection
            Return GetInstances(mgmtScope, condition, Nothing)
        End Function

        Public Overloads Shared Function GetInstances(ByVal mgmtScope As System.Management.ManagementScope, ByVal selectedProperties() As System.String) As DiskPartitionCollection
            Return GetInstances(mgmtScope, Nothing, selectedProperties)
        End Function

        Public Overloads Shared Function GetInstances(ByVal mgmtScope As System.Management.ManagementScope, ByVal condition As String, ByVal selectedProperties() As System.String) As DiskPartitionCollection
            If (mgmtScope Is Nothing) Then
                If (statMgmtScope Is Nothing) Then
                    mgmtScope = New System.Management.ManagementScope
                    mgmtScope.Path.NamespacePath = "root\cimv2"
                Else
                    mgmtScope = statMgmtScope
                End If
            End If
            Dim ObjectSearcher As System.Management.ManagementObjectSearcher = New System.Management.ManagementObjectSearcher(mgmtScope, New SelectQuery("Win32_DiskPartition", condition, selectedProperties))
            Dim enumOptions As System.Management.EnumerationOptions = New System.Management.EnumerationOptions
            enumOptions.EnsureLocatable = True
            ObjectSearcher.Options = enumOptions
            Return New DiskPartitionCollection(ObjectSearcher.Get)
        End Function

        <Browsable(True)> _
        Public Shared Function CreateInstance() As DiskPartition
            Dim mgmtScope As System.Management.ManagementScope = Nothing
            If (statMgmtScope Is Nothing) Then
                mgmtScope = New System.Management.ManagementScope
                mgmtScope.Path.NamespacePath = CreatedWmiNamespace
            Else
                mgmtScope = statMgmtScope
            End If
            Dim mgmtPath As System.Management.ManagementPath = New System.Management.ManagementPath(CreatedClassName)
            Dim tmpMgmtClass As System.Management.ManagementClass = New System.Management.ManagementClass(mgmtScope, mgmtPath, Nothing)
            Return New DiskPartition(tmpMgmtClass.CreateInstance)
        End Function

        <Browsable(True)> _
        Public Sub Delete()
            PrivateLateBoundObject.Delete()
        End Sub

        Public Function Reset() As UInteger
            If (isEmbedded = False) Then
                Dim inParams As System.Management.ManagementBaseObject = Nothing
                Dim outParams As System.Management.ManagementBaseObject = PrivateLateBoundObject.InvokeMethod("Reset", inParams, Nothing)
                Return System.Convert.ToUInt32(outParams.Properties("ReturnValue").Value)
            Else
                Return System.Convert.ToUInt32(0)
            End If
        End Function

        Public Function SetPowerState(ByVal PowerState As UShort, ByVal Time As Date) As UInteger
            If (isEmbedded = False) Then
                Dim inParams As System.Management.ManagementBaseObject = Nothing
                inParams = PrivateLateBoundObject.GetMethodParameters("SetPowerState")
                inParams("PowerState") = CType(PowerState, System.UInt16)
                inParams("Time") = ToDmtfDateTime(CType(Time, Date))
                Dim outParams As System.Management.ManagementBaseObject = PrivateLateBoundObject.InvokeMethod("SetPowerState", inParams, Nothing)
                Return System.Convert.ToUInt32(outParams.Properties("ReturnValue").Value)
            Else
                Return System.Convert.ToUInt32(0)
            End If
        End Function

        Public Enum AccessValues

            Unknown0 = 0

            Readable = 1

            Writeable = 2

            Read_Write_Supported = 3

            Write_Once = 4

            NULL_ENUM_VALUE = 5
        End Enum

        Public Enum AvailabilityValues

            Other0 = 1

            Unknown0 = 2

            Running_Full_Power = 3

            Warning = 4

            In_Test = 5

            Not_Applicable = 6

            Power_Off = 7

            Off_Line = 8

            Off_Duty = 9

            Degraded = 10

            Not_Installed = 11

            Install_Error = 12

            Power_Save_Unknown = 13

            Power_Save_Low_Power_Mode = 14

            Power_Save_Standby = 15

            Power_Cycle = 16

            Power_Save_Warning = 17

            Paused = 18

            Not_Ready = 19

            Not_Configured = 20

            Quiesced = 21

            NULL_ENUM_VALUE = 0
        End Enum

        Public Enum ConfigManagerErrorCodeValues

            This_device_is_working_properly_ = 0

            This_device_is_not_configured_correctly_ = 1

            Windows_cannot_load_the_driver_for_this_device_ = 2

            The_driver_for_this_device_might_be_corrupted_or_your_system_may_be_running_low_on_memory_or_other_resources_ = 3

            This_device_is_not_working_properly_One_of_its_drivers_or_your_registry_might_be_corrupted_ = 4

            The_driver_for_this_device_needs_a_resource_that_Windows_cannot_manage_ = 5

            The_boot_configuration_for_this_device_conflicts_with_other_devices_ = 6

            Cannot_filter_ = 7

            The_driver_loader_for_the_device_is_missing_ = 8

            This_device_is_not_working_properly_because_the_controlling_firmware_is_reporting_the_resources_for_the_device_incorrectly_ = 9

            This_device_cannot_start_ = 10

            This_device_failed_ = 11

            This_device_cannot_find_enough_free_resources_that_it_can_use_ = 12

            Windows_cannot_verify_this_device_s_resources_ = 13

            This_device_cannot_work_properly_until_you_restart_your_computer_ = 14

            This_device_is_not_working_properly_because_there_is_probably_a_re_enumeration_problem_ = 15

            Windows_cannot_identify_all_the_resources_this_device_uses_ = 16

            This_device_is_asking_for_an_unknown_resource_type_ = 17

            Reinstall_the_drivers_for_this_device_ = 18

            Failure_using_the_VxD_loader_ = 19

            Your_registry_might_be_corrupted_ = 20

            System_failure_Try_changing_the_driver_for_this_device_If_that_does_not_work_see_your_hardware_documentation_Windows_is_removing_this_device_ = 21

            This_device_is_disabled_ = 22

            System_failure_Try_changing_the_driver_for_this_device_If_that_doesn_t_work_see_your_hardware_documentation_ = 23

            This_device_is_not_present_is_not_working_properly_or_does_not_have_all_its_drivers_installed_ = 24

            Windows_is_still_setting_up_this_device_ = 25

            Windows_is_still_setting_up_this_device_0 = 26

            This_device_does_not_have_valid_log_configuration_ = 27

            The_drivers_for_this_device_are_not_installed_ = 28

            This_device_is_disabled_because_the_firmware_of_the_device_did_not_give_it_the_required_resources_ = 29

            This_device_is_using_an_Interrupt_Request_IRQ_resource_that_another_device_is_using_ = 30

            This_device_is_not_working_properly_because_Windows_cannot_load_the_drivers_required_for_this_device_ = 31

            NULL_ENUM_VALUE = 32
        End Enum

        Public Enum PowerManagementCapabilitiesValues

            Unknown0 = 0

            Not_Supported = 1

            Disabled = 2

            Enabled = 3

            Power_Saving_Modes_Entered_Automatically = 4

            Power_State_Settable = 5

            Power_Cycling_Supported = 6

            Timed_Power_On_Supported = 7

            NULL_ENUM_VALUE = 8
        End Enum

        Public Enum StatusInfoValues

            Other0 = 1

            Unknown0 = 2

            Enabled = 3

            Disabled = 4

            Not_Applicable = 5

            NULL_ENUM_VALUE = 0
        End Enum

        'Enumerator implementation for enumerating instances of the class.
        Public Class DiskPartitionCollection
            Inherits Object
            Implements ICollection

            Private privColObj As ManagementObjectCollection

            Public Sub New(ByVal objCollection As ManagementObjectCollection)
                MyBase.New()
                privColObj = objCollection
            End Sub

            Public Overridable ReadOnly Property Count() As Integer Implements System.Collections.ICollection.Count
                Get
                    Return privColObj.Count
                End Get
            End Property

            Public Overridable ReadOnly Property IsSynchronized() As Boolean Implements System.Collections.ICollection.IsSynchronized
                Get
                    Return privColObj.IsSynchronized
                End Get
            End Property

            Public Overridable ReadOnly Property SyncRoot() As Object Implements System.Collections.ICollection.SyncRoot
                Get
                    Return Me
                End Get
            End Property

            Public Overridable Sub CopyTo(ByVal array As System.Array, ByVal index As Integer) Implements System.Collections.ICollection.CopyTo
                privColObj.CopyTo(array, index)
                Dim nCtr As Integer
                nCtr = 0
                Do While (nCtr < array.Length)
                    array.SetValue(New DiskPartition(CType(array.GetValue(nCtr), System.Management.ManagementObject)), nCtr)
                    nCtr = (nCtr + 1)
                Loop
            End Sub

            Public Overridable Function GetEnumerator() As System.Collections.IEnumerator Implements System.Collections.IEnumerable.GetEnumerator
                Return New DiskPartitionEnumerator(privColObj.GetEnumerator)
            End Function

            Public Class DiskPartitionEnumerator
                Inherits Object
                Implements System.Collections.IEnumerator

                Private privObjEnum As ManagementObjectCollection.ManagementObjectEnumerator

                Public Sub New(ByVal objEnum As ManagementObjectCollection.ManagementObjectEnumerator)
                    MyBase.New()
                    privObjEnum = objEnum
                End Sub

                Public Overridable ReadOnly Property Current() As Object Implements System.Collections.IEnumerator.Current
                    Get
                        Return New DiskPartition(CType(privObjEnum.Current, System.Management.ManagementObject))
                    End Get
                End Property

                Public Overridable Function MoveNext() As Boolean Implements System.Collections.IEnumerator.MoveNext
                    Return privObjEnum.MoveNext
                End Function

                Public Overridable Sub Reset() Implements System.Collections.IEnumerator.Reset
                    privObjEnum.Reset()
                End Sub
            End Class
        End Class

        'TypeConverter to handle null values for ValueType properties
        Public Class WMIValueTypeConverter
            Inherits TypeConverter

            Private baseConverter As TypeConverter

            Private baseType As System.Type

            Public Sub New(ByVal inBaseType As System.Type)
                MyBase.New()
                baseConverter = TypeDescriptor.GetConverter(inBaseType)
                baseType = inBaseType
            End Sub

            Public Overloads Overrides Function CanConvertFrom(ByVal context As System.ComponentModel.ITypeDescriptorContext, ByVal srcType As System.Type) As Boolean
                Return baseConverter.CanConvertFrom(context, srcType)
            End Function

            Public Overloads Overrides Function CanConvertTo(ByVal context As System.ComponentModel.ITypeDescriptorContext, ByVal destinationType As System.Type) As Boolean
                Return baseConverter.CanConvertTo(context, destinationType)
            End Function

            Public Overloads Overrides Function ConvertFrom(ByVal context As System.ComponentModel.ITypeDescriptorContext, ByVal culture As System.Globalization.CultureInfo, ByVal value As Object) As Object
                Return baseConverter.ConvertFrom(context, culture, value)
            End Function

            Public Overloads Overrides Function CreateInstance(ByVal context As System.ComponentModel.ITypeDescriptorContext, ByVal dictionary As System.Collections.IDictionary) As Object
                Return baseConverter.CreateInstance(context, dictionary)
            End Function

            Public Overloads Overrides Function GetCreateInstanceSupported(ByVal context As System.ComponentModel.ITypeDescriptorContext) As Boolean
                Return baseConverter.GetCreateInstanceSupported(context)
            End Function

            Public Overloads Overrides Function GetProperties(ByVal context As System.ComponentModel.ITypeDescriptorContext, ByVal value As Object, ByVal attributeVar() As System.Attribute) As PropertyDescriptorCollection
                Return baseConverter.GetProperties(context, value, attributeVar)
            End Function

            Public Overloads Overrides Function GetPropertiesSupported(ByVal context As System.ComponentModel.ITypeDescriptorContext) As Boolean
                Return baseConverter.GetPropertiesSupported(context)
            End Function

            Public Overloads Overrides Function GetStandardValues(ByVal context As System.ComponentModel.ITypeDescriptorContext) As System.ComponentModel.TypeConverter.StandardValuesCollection
                Return baseConverter.GetStandardValues(context)
            End Function

            Public Overloads Overrides Function GetStandardValuesExclusive(ByVal context As System.ComponentModel.ITypeDescriptorContext) As Boolean
                Return baseConverter.GetStandardValuesExclusive(context)
            End Function

            Public Overloads Overrides Function GetStandardValuesSupported(ByVal context As System.ComponentModel.ITypeDescriptorContext) As Boolean
                Return baseConverter.GetStandardValuesSupported(context)
            End Function

            Public Overloads Overrides Function ConvertTo(ByVal context As System.ComponentModel.ITypeDescriptorContext, ByVal culture As System.Globalization.CultureInfo, ByVal value As Object, ByVal destinationType As System.Type) As Object
                If (baseType.BaseType Is GetType(System.[Enum])) Then
                    If (value.GetType Is destinationType) Then
                        Return value
                    End If
                    If (((value = Nothing) _
                                AndAlso (Not (context) Is Nothing)) _
                                AndAlso (context.PropertyDescriptor.ShouldSerializeValue(context.Instance) = False)) Then
                        Return "NULL_ENUM_VALUE"
                    End If
                    Return baseConverter.ConvertTo(context, culture, value, destinationType)
                End If
                If ((baseType Is GetType(Boolean)) _
                            AndAlso (baseType.BaseType Is GetType(System.ValueType))) Then
                    If (((value = Nothing) _
                                AndAlso (Not (context) Is Nothing)) _
                                AndAlso (context.PropertyDescriptor.ShouldSerializeValue(context.Instance) = False)) Then
                        Return ""
                    End If
                    Return baseConverter.ConvertTo(context, culture, value, destinationType)
                End If
                If ((Not (context) Is Nothing) _
                            AndAlso (context.PropertyDescriptor.ShouldSerializeValue(context.Instance) = False)) Then
                    Return ""
                End If
                Return baseConverter.ConvertTo(context, culture, value, destinationType)
            End Function
        End Class

        'Embedded class to represent WMI system Properties.
        <TypeConverter(GetType(System.ComponentModel.ExpandableObjectConverter))> _
        Public Class ManagementSystemProperties

            Private PrivateLateBoundObject As System.Management.ManagementBaseObject

            Public Sub New(ByVal ManagedObject As System.Management.ManagementBaseObject)
                MyBase.New()
                PrivateLateBoundObject = ManagedObject
            End Sub

            <Browsable(True)> _
            Public ReadOnly Property GENUS() As Integer
                Get
                    Return CType(PrivateLateBoundObject("__GENUS"), Integer)
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property [CLASS]() As String
                Get
                    Return CType(PrivateLateBoundObject("__CLASS"), String)
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property SUPERCLASS() As String
                Get
                    Return CType(PrivateLateBoundObject("__SUPERCLASS"), String)
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property DYNASTY() As String
                Get
                    Return CType(PrivateLateBoundObject("__DYNASTY"), String)
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property RELPATH() As String
                Get
                    Return CType(PrivateLateBoundObject("__RELPATH"), String)
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property PROPERTY_COUNT() As Integer
                Get
                    Return CType(PrivateLateBoundObject("__PROPERTY_COUNT"), Integer)
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property DERIVATION() As String()
                Get
                    Return CType(PrivateLateBoundObject("__DERIVATION"), String())
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property SERVER() As String
                Get
                    Return CType(PrivateLateBoundObject("__SERVER"), String)
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property [NAMESPACE]() As String
                Get
                    Return CType(PrivateLateBoundObject("__NAMESPACE"), String)
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property PATH() As String
                Get
                    Return CType(PrivateLateBoundObject("__PATH"), String)
                End Get
            End Property
        End Class
    End Class

    'Functions ShouldSerialize<PropertyName> are functions used by VS property browser to check if a particular property has to be serialized. These functions are added for all ValueType properties ( properties of type Int32, BOOL etc.. which cannot be set to null). These functions use Is<PropertyName>Null function. These functions are also used in the TypeConverter implementation for the properties to check for NULL value of property so that an empty value can be shown in Property browser in case of Drag and Drop in Visual studio.
    'Functions Is<PropertyName>Null() are used to check if a property is NULL.
    'Functions Reset<PropertyName> are added for Nullable Read/Write properties. These functions are used by VS designer in property browser to set a property to NULL.
    'Every property added to the class for WMI property has attributes set to define its behavior in Visual Studio designer and also to define a TypeConverter to be used.
    'Datetime conversion functions ToDateTime and ToDmtfDateTime are added to the class to convert DMTF datetime to System.DateTime and vice-versa.
    'An Early Bound class generated for the WMI class.Win32_Processor
    Public Class Processor
        Inherits System.ComponentModel.Component

        'Private property to hold the WMI namespace in which the class resides.
        Private Shared CreatedWmiNamespace As String = "root\cimv2"

        'Private property to hold the name of WMI class which created this class.
        Private Shared CreatedClassName As String = "Win32_Processor"

        'Private member variable to hold the ManagementScope which is used by the various methods.
        Private Shared statMgmtScope As System.Management.ManagementScope = Nothing

        Private PrivateSystemProperties As ManagementSystemProperties

        'Underlying lateBound WMI object.
        Private PrivateLateBoundObject As System.Management.ManagementObject

        'Member variable to store the 'automatic commit' behavior for the class.
        Private AutoCommitProp As Boolean

        'Private variable to hold the embedded property representing the instance.
        Private embeddedObj As System.Management.ManagementBaseObject

        'The current WMI object used
        Private curObj As System.Management.ManagementBaseObject

        'Flag to indicate if the instance is an embedded object.
        Private isEmbedded As Boolean

        'Below are different overloads of constructors to initialize an instance of the class with a WMI object.
        Public Sub New()
            MyBase.New()
            Me.InitializeObject(Nothing, Nothing, Nothing)
        End Sub

        Public Sub New(ByVal keyDeviceID As String)
            MyBase.New()
            Me.InitializeObject(Nothing, New System.Management.ManagementPath(Processor.ConstructPath(keyDeviceID)), Nothing)
        End Sub

        Public Sub New(ByVal mgmtScope As System.Management.ManagementScope, ByVal keyDeviceID As String)
            MyBase.New()
            Me.InitializeObject(CType(mgmtScope, System.Management.ManagementScope), New System.Management.ManagementPath(Processor.ConstructPath(keyDeviceID)), Nothing)
        End Sub

        Public Sub New(ByVal path As System.Management.ManagementPath, ByVal getOptions As System.Management.ObjectGetOptions)
            MyBase.New()
            Me.InitializeObject(Nothing, path, getOptions)
        End Sub

        Public Sub New(ByVal mgmtScope As System.Management.ManagementScope, ByVal path As System.Management.ManagementPath)
            MyBase.New()
            Me.InitializeObject(mgmtScope, path, Nothing)
        End Sub

        Public Sub New(ByVal path As System.Management.ManagementPath)
            MyBase.New()
            Me.InitializeObject(Nothing, path, Nothing)
        End Sub

        Public Sub New(ByVal mgmtScope As System.Management.ManagementScope, ByVal path As System.Management.ManagementPath, ByVal getOptions As System.Management.ObjectGetOptions)
            MyBase.New()
            Me.InitializeObject(mgmtScope, path, getOptions)
        End Sub

        Public Sub New(ByVal theObject As System.Management.ManagementObject)
            MyBase.New()
            Initialize()
            If (CheckIfProperClass(theObject) = True) Then
                PrivateLateBoundObject = theObject
                PrivateSystemProperties = New ManagementSystemProperties(PrivateLateBoundObject)
                curObj = PrivateLateBoundObject
            Else
                Throw New System.ArgumentException("Class name does not match.")
            End If
        End Sub

        Public Sub New(ByVal theObject As System.Management.ManagementBaseObject)
            MyBase.New()
            Initialize()
            If (CheckIfProperClass(theObject) = True) Then
                embeddedObj = theObject
                PrivateSystemProperties = New ManagementSystemProperties(theObject)
                curObj = embeddedObj
                isEmbedded = True
            Else
                Throw New System.ArgumentException("Class name does not match.")
            End If
        End Sub

        'Property returns the namespace of the WMI class.
        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property OriginatingNamespace() As String
            Get
                Return "root\cimv2"
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property ManagementClassName() As String
            Get
                Dim strRet As String = CreatedClassName
                If (Not (curObj) Is Nothing) Then
                    If (Not (curObj.ClassPath) Is Nothing) Then
                        strRet = CType(curObj("__CLASS"), String)
                        If ((strRet Is Nothing) _
                                    OrElse (strRet Is String.Empty)) Then
                            strRet = CreatedClassName
                        End If
                    End If
                End If
                Return strRet
            End Get
        End Property

        'Property pointing to an embedded object to get System properties of the WMI object.
        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property SystemProperties() As ManagementSystemProperties
            Get
                Return PrivateSystemProperties
            End Get
        End Property

        'Property returning the underlying lateBound object.
        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property LateBoundObject() As System.Management.ManagementBaseObject
            Get
                Return curObj
            End Get
        End Property

        'ManagementScope of the object.
        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public Property Scope() As System.Management.ManagementScope
            Get
                If (isEmbedded = False) Then
                    Return PrivateLateBoundObject.Scope
                Else
                    Return Nothing
                End If
            End Get
            Set(ByVal value As System.Management.ManagementScope)
                If (isEmbedded = False) Then
                    PrivateLateBoundObject.Scope = value
                End If
            End Set
        End Property

        'Property to show the commit behavior for the WMI object. If true, WMI object will be automatically saved after each property modification.(ie. Put() is called after modification of a property).
        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public Property AutoCommit() As Boolean
            Get
                Return AutoCommitProp
            End Get
            Set(ByVal value As Boolean)
                AutoCommitProp = value
            End Set
        End Property

        'The ManagementPath of the underlying WMI object.
        <Browsable(True)> _
        Public Property Path() As System.Management.ManagementPath
            Get
                If (isEmbedded = False) Then
                    Return PrivateLateBoundObject.Path
                Else
                    Return Nothing
                End If
            End Get
            Set(ByVal value As System.Management.ManagementPath)
                If (isEmbedded = False) Then
                    If (CheckIfProperClass(Nothing, value, Nothing) <> True) Then
                        Throw New System.ArgumentException("Class name does not match.")
                    End If
                    PrivateLateBoundObject.Path = value
                End If
            End Set
        End Property

        'Public static scope property which is used by the various methods.
        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public Shared Property StaticScope() As System.Management.ManagementScope
            Get
                Return statMgmtScope
            End Get
            Set(ByVal value As System.Management.ManagementScope)
                statMgmtScope = value
            End Set
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsAddressWidthNull() As Boolean
            Get
                If (curObj("AddressWidth") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("Processor address width in bits."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property AddressWidth() As UShort
            Get
                If (curObj("AddressWidth") Is Nothing) Then
                    Return System.Convert.ToUInt16(0)
                End If
                Return CType(curObj("AddressWidth"), UShort)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsArchitectureNull() As Boolean
            Get
                If (curObj("Architecture") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The Architecture property specifies the processor architecture used by this platf" & _
            "orm. It returns one of the following        integer values:" & Global.Microsoft.VisualBasic.ChrW(10) & "0 - x86 " & Global.Microsoft.VisualBasic.ChrW(10) & "1 - MIPS " & Global.Microsoft.VisualBasic.ChrW(10) & "2" & _
            " - Alpha " & Global.Microsoft.VisualBasic.ChrW(10) & "3 - PowerPC " & Global.Microsoft.VisualBasic.ChrW(10) & "6 - ia64 " & Global.Microsoft.VisualBasic.ChrW(10) & "9 - x64 " & Global.Microsoft.VisualBasic.ChrW(10)), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property Architecture() As ArchitectureValues
            Get
                If (curObj("Architecture") Is Nothing) Then
                    Return CType(System.Convert.ToInt32(10), ArchitectureValues)
                End If
                Return CType(System.Convert.ToInt32(curObj("Architecture")), ArchitectureValues)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsAvailabilityNull() As Boolean
            Get
                If (curObj("Availability") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The availability and status of the device.  For example, the Availability propert" & _
            "y indicates that the device is running and has full power (value=3), or is in a " & _
            "warning (4), test (5), degraded (10) or power save state (values 13-15 and 17). " & _
            "Regarding the power saving states, these are defined as follows: Value 13 (""Powe" & _
            "r Save - Unknown"") indicates that the device is known to be in a power save mode" & _
            ", but its exact status in this mode is unknown; 14 (""Power Save - Low Power Mode" & _
            """) indicates that the device is in a power save state but still functioning, and" & _
            " may exhibit degraded performance; 15 (""Power Save - Standby"") describes that th" & _
            "e device is not functioning but could be brought to full power 'quickly'; and va" & _
            "lue 17 (""Power Save - Warning"") indicates that the device is in a warning state," & _
            " though also in a power save mode."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property Availability() As AvailabilityValues
            Get
                If (curObj("Availability") Is Nothing) Then
                    Return CType(System.Convert.ToInt32(0), AvailabilityValues)
                End If
                Return CType(System.Convert.ToInt32(curObj("Availability")), AvailabilityValues)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The Caption property is a short textual description (one-line string) of the obje" & _
            "ct.")> _
        Public ReadOnly Property Caption() As String
            Get
                Return CType(curObj("Caption"), String)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsConfigManagerErrorCodeNull() As Boolean
            Get
                If (curObj("ConfigManagerErrorCode") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("Indicates the Win32 Configuration Manager error code.  The following values may b" & _
            "e returned: " & Global.Microsoft.VisualBasic.ChrW(10) & "0      This device is working properly. " & Global.Microsoft.VisualBasic.ChrW(10) & "1      This device is not " & _
            "configured correctly. " & Global.Microsoft.VisualBasic.ChrW(10) & "2      Windows cannot load the driver for this device. " & Global.Microsoft.VisualBasic.ChrW(10) & "3" & _
            "      The driver for this device might be corrupted, or your system may be runni" & _
            "ng low on memory or other resources. " & Global.Microsoft.VisualBasic.ChrW(10) & "4      This device is not working properly" & _
            ". One of its drivers or your registry might be corrupted. " & Global.Microsoft.VisualBasic.ChrW(10) & "5      The driver for" & _
            " this device needs a resource that Windows cannot manage. " & Global.Microsoft.VisualBasic.ChrW(10) & "6      The boot confi" & _
            "guration for this device conflicts with other devices. " & Global.Microsoft.VisualBasic.ChrW(10) & "7      Cannot filter. " & Global.Microsoft.VisualBasic.ChrW(10) & "8" & _
            "      The driver loader for the device is missing. " & Global.Microsoft.VisualBasic.ChrW(10) & "9      This device is not wo" & _
            "rking properly because the controlling firmware is reporting the resources for t" & _
            "he device incorrectly. " & Global.Microsoft.VisualBasic.ChrW(10) & "10     This device cannot start. " & Global.Microsoft.VisualBasic.ChrW(10) & "11     This device fai" & _
            "led. " & Global.Microsoft.VisualBasic.ChrW(10) & "12     This device cannot find enough free resources that it can use. " & Global.Microsoft.VisualBasic.ChrW(10) & "13 " & _
            "    Windows cannot verify this device's resources. " & Global.Microsoft.VisualBasic.ChrW(10) & "14     This device cannot wo" & _
            "rk properly until you restart your computer. " & Global.Microsoft.VisualBasic.ChrW(10) & "15     This device is not working " & _
            "properly because there is probably a re-enumeration problem. " & Global.Microsoft.VisualBasic.ChrW(10) & "16     Windows can" & _
            "not identify all the resources this device uses. " & Global.Microsoft.VisualBasic.ChrW(10) & "17     This device is asking f" & _
            "or an unknown resource type. " & Global.Microsoft.VisualBasic.ChrW(10) & "18     Reinstall the drivers for this device. " & Global.Microsoft.VisualBasic.ChrW(10) & "19 " & _
            "    Your registry might be corrupted. " & Global.Microsoft.VisualBasic.ChrW(10) & "20     Failure using the VxD loader. " & Global.Microsoft.VisualBasic.ChrW(10) & "21 " & _
            "    System failure: Try changing the driver for this device. If that does not wo" & _
            "rk, see your hardware documentation. Windows is removing this device. " & Global.Microsoft.VisualBasic.ChrW(10) & "22     Th" & _
            "is device is disabled. " & Global.Microsoft.VisualBasic.ChrW(10) & "23     System failure: Try changing the driver for this " & _
            "device. If that doesn't work, see your hardware documentation. " & Global.Microsoft.VisualBasic.ChrW(10) & "24     This devi" & _
            "ce is not present, is not working properly, or does not have all its drivers ins" & _
            "talled. " & Global.Microsoft.VisualBasic.ChrW(10) & "25     Windows is still setting up this device. " & Global.Microsoft.VisualBasic.ChrW(10) & "26     Windows is stil" & _
            "l setting up this device. " & Global.Microsoft.VisualBasic.ChrW(10) & "27     This device does not have valid log configurat" & _
            "ion. " & Global.Microsoft.VisualBasic.ChrW(10) & "28     The drivers for this device are not installed. " & Global.Microsoft.VisualBasic.ChrW(10) & "29     This device " & _
            "is disabled because the firmware of the device did not give it the required reso" & _
            "urces. " & Global.Microsoft.VisualBasic.ChrW(10) & "30     This device is using an Interrupt Request (IRQ) resource that ano" & _
            "ther device is using. " & Global.Microsoft.VisualBasic.ChrW(10) & "31     This device is not working properly because Window" & _
            "s cannot load the drivers required for this device."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property ConfigManagerErrorCode() As ConfigManagerErrorCodeValues
            Get
                If (curObj("ConfigManagerErrorCode") Is Nothing) Then
                    Return CType(System.Convert.ToInt32(32), ConfigManagerErrorCodeValues)
                End If
                Return CType(System.Convert.ToInt32(curObj("ConfigManagerErrorCode")), ConfigManagerErrorCodeValues)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsConfigManagerUserConfigNull() As Boolean
            Get
                If (curObj("ConfigManagerUserConfig") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("Indicates whether the device is using a user-defined configuration."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property ConfigManagerUserConfig() As Boolean
            Get
                If (curObj("ConfigManagerUserConfig") Is Nothing) Then
                    Return System.Convert.ToBoolean(0)
                End If
                Return CType(curObj("ConfigManagerUserConfig"), Boolean)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsCpuStatusNull() As Boolean
            Get
                If (curObj("CpuStatus") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The CpuStatus property specifies the current status of the processor. Changes in " & _
            "status arise from processor usage, not the physical condition of the processor."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property CpuStatus() As CpuStatusValues
            Get
                If (curObj("CpuStatus") Is Nothing) Then
                    Return CType(System.Convert.ToInt32(8), CpuStatusValues)
                End If
                Return CType(System.Convert.ToInt32(curObj("CpuStatus")), CpuStatusValues)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("CreationClassName indicates the name of the class or the subclass used in the cre" & _
            "ation of an instance. When used with the other key properties of this class, thi" & _
            "s property allows all instances of this class and its subclasses to be uniquely " & _
            "identified.")> _
        Public ReadOnly Property CreationClassName() As String
            Get
                Return CType(curObj("CreationClassName"), String)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsCurrentClockSpeedNull() As Boolean
            Get
                If (curObj("CurrentClockSpeed") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The current speed (in MHz) of this processor."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property CurrentClockSpeed() As UInteger
            Get
                If (curObj("CurrentClockSpeed") Is Nothing) Then
                    Return System.Convert.ToUInt32(0)
                End If
                Return CType(curObj("CurrentClockSpeed"), UInteger)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsCurrentVoltageNull() As Boolean
            Get
                If (curObj("CurrentVoltage") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The CurrentVoltage specifies the voltage of the processor. bits 0-6 of the field " & _
            "contain the processor's current voltage times 10. This value is only set when SM" & _
            "BIOS designates a voltage value. For specific values, see VoltageCaps." & Global.Microsoft.VisualBasic.ChrW(10) & "Example: " & _
            "field value for a processor voltage of 1.8 volts would be 92h = 80h + (1.8 x 10)" & _
            " = 80h + 18 = 80h + 12h."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property CurrentVoltage() As UShort
            Get
                If (curObj("CurrentVoltage") Is Nothing) Then
                    Return System.Convert.ToUInt16(0)
                End If
                Return CType(curObj("CurrentVoltage"), UShort)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsDataWidthNull() As Boolean
            Get
                If (curObj("DataWidth") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("Processor data width in bits."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property DataWidth() As UShort
            Get
                If (curObj("DataWidth") Is Nothing) Then
                    Return System.Convert.ToUInt16(0)
                End If
                Return CType(curObj("DataWidth"), UShort)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The Description property provides a textual description of the object. ")> _
        Public ReadOnly Property Description() As String
            Get
                Return CType(curObj("Description"), String)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The DeviceID property contains a string uniquely identifying the processor with o" & _
            "ther devices on the system.")> _
        Public ReadOnly Property DeviceID() As String
            Get
                Return CType(curObj("DeviceID"), String)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsErrorClearedNull() As Boolean
            Get
                If (curObj("ErrorCleared") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("ErrorCleared is a boolean property indicating that the error reported in LastErro" & _
            "rCode property is now cleared."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property ErrorCleared() As Boolean
            Get
                If (curObj("ErrorCleared") Is Nothing) Then
                    Return System.Convert.ToBoolean(0)
                End If
                Return CType(curObj("ErrorCleared"), Boolean)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("ErrorDescription is a free-form string supplying more information about the error" & _
            " recorded in LastErrorCode property, and information on any corrective actions t" & _
            "hat may be taken.")> _
        Public ReadOnly Property ErrorDescription() As String
            Get
                Return CType(curObj("ErrorDescription"), String)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsExtClockNull() As Boolean
            Get
                If (curObj("ExtClock") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The ExtClock property specifies the external clock frequency. If the frequency is" & _
            " unknown this property is set to null."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property ExtClock() As UInteger
            Get
                If (curObj("ExtClock") Is Nothing) Then
                    Return System.Convert.ToUInt32(0)
                End If
                Return CType(curObj("ExtClock"), UInteger)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsFamilyNull() As Boolean
            Get
                If (curObj("Family") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The processor family type. For example, values include ""Pentium(R) processor with" & _
            " MMX(TM) technology"" (14) and ""68040"" (96)."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property Family() As FamilyValues
            Get
                If (curObj("Family") Is Nothing) Then
                    Return CType(System.Convert.ToInt32(0), FamilyValues)
                End If
                Return CType(System.Convert.ToInt32(curObj("Family")), FamilyValues)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsInstallDateNull() As Boolean
            Get
                If (curObj("InstallDate") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The InstallDate property is datetime value indicating when the object was install" & _
            "ed. A lack of a value does not indicate that the object is not installed."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property InstallDate() As Date
            Get
                If (Not (curObj("InstallDate")) Is Nothing) Then
                    Return ToDateTime(CType(curObj("InstallDate"), String))
                Else
                    Return Date.MinValue
                End If
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsL2CacheSizeNull() As Boolean
            Get
                If (curObj("L2CacheSize") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The L2CacheSize property specifies the size of the processor's Level 2 cache. A L" & _
            "evel 2 cache is an external memory area that has a faster access times than the " & _
            "main RAM memory."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property L2CacheSize() As UInteger
            Get
                If (curObj("L2CacheSize") Is Nothing) Then
                    Return System.Convert.ToUInt32(0)
                End If
                Return CType(curObj("L2CacheSize"), UInteger)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsL2CacheSpeedNull() As Boolean
            Get
                If (curObj("L2CacheSpeed") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The L2CacheSpeed property specifies the clockspeed of the processor's Level 2 cac" & _
            "he. A Level 2 cache is an external memory area that has a faster access times th" & _
            "an the main RAM memory."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property L2CacheSpeed() As UInteger
            Get
                If (curObj("L2CacheSpeed") Is Nothing) Then
                    Return System.Convert.ToUInt32(0)
                End If
                Return CType(curObj("L2CacheSpeed"), UInteger)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsL3CacheSizeNull() As Boolean
            Get
                If (curObj("L3CacheSize") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The L3CacheSize property specifies the size of the processor's Level 3 cache. A L" & _
            "evel 3 cache is an external memory area that has a faster access times than the " & _
            "main RAM memory."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property L3CacheSize() As UInteger
            Get
                If (curObj("L3CacheSize") Is Nothing) Then
                    Return System.Convert.ToUInt32(0)
                End If
                Return CType(curObj("L3CacheSize"), UInteger)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsL3CacheSpeedNull() As Boolean
            Get
                If (curObj("L3CacheSpeed") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The L3CacheSpeed property specifies the clockspeed of the processor's Level 3 cac" & _
            "he. A Level 3 cache is an external memory area that has a faster access times th" & _
            "an the main RAM memory."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property L3CacheSpeed() As UInteger
            Get
                If (curObj("L3CacheSpeed") Is Nothing) Then
                    Return System.Convert.ToUInt32(0)
                End If
                Return CType(curObj("L3CacheSpeed"), UInteger)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsLastErrorCodeNull() As Boolean
            Get
                If (curObj("LastErrorCode") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("LastErrorCode captures the last error code reported by the logical device."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property LastErrorCode() As UInteger
            Get
                If (curObj("LastErrorCode") Is Nothing) Then
                    Return System.Convert.ToUInt32(0)
                End If
                Return CType(curObj("LastErrorCode"), UInteger)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsLevelNull() As Boolean
            Get
                If (curObj("Level") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The Level property further defines the processor type. The value  depends on the " & _
            "architecture of the processor."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property Level() As UShort
            Get
                If (curObj("Level") Is Nothing) Then
                    Return System.Convert.ToUInt16(0)
                End If
                Return CType(curObj("Level"), UShort)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsLoadPercentageNull() As Boolean
            Get
                If (curObj("LoadPercentage") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The LoadPercentage property specifies each processor's load capacity averaged ove" & _
            "r the last second. The term 'processor loading' refers to the total computing bu" & _
            "rden each processor carries at one time."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property LoadPercentage() As UShort
            Get
                If (curObj("LoadPercentage") Is Nothing) Then
                    Return System.Convert.ToUInt16(0)
                End If
                Return CType(curObj("LoadPercentage"), UShort)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The Manufacturer property specifies the name of the processor's manufacturer." & Global.Microsoft.VisualBasic.ChrW(10) & "Exa" & _
            "mple: GenuineSilicon")> _
        Public ReadOnly Property Manufacturer() As String
            Get
                Return CType(curObj("Manufacturer"), String)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsMaxClockSpeedNull() As Boolean
            Get
                If (curObj("MaxClockSpeed") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The maximum speed (in MHz) of this processor."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property MaxClockSpeed() As UInteger
            Get
                If (curObj("MaxClockSpeed") Is Nothing) Then
                    Return System.Convert.ToUInt32(0)
                End If
                Return CType(curObj("MaxClockSpeed"), UInteger)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The Name property defines the label by which the object is known. When subclassed" & _
            ", the Name property can be overridden to be a Key property.")> _
        Public ReadOnly Property Name() As String
            Get
                Return CType(curObj("Name"), String)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsNumberOfCoresNull() As Boolean
            Get
                If (curObj("NumberOfCores") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The NumberOfCores property contains a Processor's total number of cores. e.g dual" & _
            " core machine will have NumberOfCores = 2."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property NumberOfCores() As UInteger
            Get
                If (curObj("NumberOfCores") Is Nothing) Then
                    Return System.Convert.ToUInt32(0)
                End If
                Return CType(curObj("NumberOfCores"), UInteger)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsNumberOfLogicalProcessorsNull() As Boolean
            Get
                If (curObj("NumberOfLogicalProcessors") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The NumberOfLogicalProcessors property specifies the total number of logical proc" & _
            "essors."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property NumberOfLogicalProcessors() As UInteger
            Get
                If (curObj("NumberOfLogicalProcessors") Is Nothing) Then
                    Return System.Convert.ToUInt32(0)
                End If
                Return CType(curObj("NumberOfLogicalProcessors"), UInteger)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("A string describing the processor family type - used when the family property is " & _
            "set to 1 (""Other""). This string should be set to NULL when the family property i" & _
            "s any value other than 1.")> _
        Public ReadOnly Property OtherFamilyDescription() As String
            Get
                Return CType(curObj("OtherFamilyDescription"), String)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("Indicates the Win32 Plug and Play device ID of the logical device.  Example: *PNP" & _
            "030b")> _
        Public ReadOnly Property PNPDeviceID() As String
            Get
                Return CType(curObj("PNPDeviceID"), String)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("Indicates the specific power-related capabilities of the logical device. The arra" & _
            "y values, 0=""Unknown"", 1=""Not Supported"" and 2=""Disabled"" are self-explanatory. " & _
            "The value, 3=""Enabled"" indicates that the power management features are currentl" & _
            "y enabled but the exact feature set is unknown or the information is unavailable" & _
            ". ""Power Saving Modes Entered Automatically"" (4) describes that a device can cha" & _
            "nge its power state based on usage or other criteria. ""Power State Settable"" (5)" & _
            " indicates that the SetPowerState method is supported. ""Power Cycling Supported""" & _
            " (6) indicates that the SetPowerState method can be invoked with the PowerState " & _
            "input variable set to 5 (""Power Cycle""). ""Timed Power On Supported"" (7) indicate" & _
            "s that the SetPowerState method can be invoked with the PowerState input variabl" & _
            "e set to 5 (""Power Cycle"") and the Time parameter set to a specific date and tim" & _
            "e, or interval, for power-on.")> _
        Public ReadOnly Property PowerManagementCapabilities() As PowerManagementCapabilitiesValues()
            Get
                Dim arrEnumVals As System.Array = CType(curObj("PowerManagementCapabilities"), System.Array)
                Dim enumToRet((arrEnumVals.Length) - 1) As PowerManagementCapabilitiesValues
                Dim counter As Integer = 0
                counter = 0
                Do While (counter < arrEnumVals.Length)
                    enumToRet(counter) = CType(System.Convert.ToInt32(arrEnumVals.GetValue(counter)), PowerManagementCapabilitiesValues)
                    counter = (counter + 1)
                Loop
                Return enumToRet
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsPowerManagementSupportedNull() As Boolean
            Get
                If (curObj("PowerManagementSupported") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("Boolean indicating that the Device can be power managed - ie, put into a power sa" & _
            "ve state. This boolean does not indicate that power management features are curr" & _
            "ently enabled, or if enabled, what features are supported. Refer to the PowerMan" & _
            "agementCapabilities array for this information. If this boolean is false, the in" & _
            "teger value 1, for the string, ""Not Supported"", should be the only entry in the " & _
            "PowerManagementCapabilities array."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property PowerManagementSupported() As Boolean
            Get
                If (curObj("PowerManagementSupported") Is Nothing) Then
                    Return System.Convert.ToBoolean(0)
                End If
                Return CType(curObj("PowerManagementSupported"), Boolean)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The ProcessorId property contains processor-specific information that describes t" & _
            "he processor's features. For x86 class CPUs, the field's format depends on the p" & _
            "rocessor's support of the CPUID instruction. If the instruction is supported, th" & _
            "e ProcessorId property contains two DWORD-formatted values. The first (offsets 0" & _
            "8h-0Bh) is the EAX value returned by a CPUID instruction with input EAX set to 1" & _
            ". The second (offsets 0Ch-0Fh) is the EDX value returned by that instruction. On" & _
            "ly the first two bytes of the ProcessorID property are significant (all others a" & _
            "re set to 0) and contain (in WORD-format) the contents of the DX register at CPU" & _
            " reset.")> _
        Public ReadOnly Property ProcessorId() As String
            Get
                Return CType(curObj("ProcessorId"), String)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsProcessorTypeNull() As Boolean
            Get
                If (curObj("ProcessorType") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The ProcessorType property specifies the processor's primary function."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property ProcessorType() As ProcessorTypeValues
            Get
                If (curObj("ProcessorType") Is Nothing) Then
                    Return CType(System.Convert.ToInt32(0), ProcessorTypeValues)
                End If
                Return CType(System.Convert.ToInt32(curObj("ProcessorType")), ProcessorTypeValues)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsRevisionNull() As Boolean
            Get
                If (curObj("Revision") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The Revision property specifies the system's architecture-dependent revision leve" & _
            "l. The meaning of this value depends on the architecture of the processor. It co" & _
            "ntains the same values as the ""Version"" member, but in a numerical format."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property Revision() As UShort
            Get
                If (curObj("Revision") Is Nothing) Then
                    Return System.Convert.ToUInt16(0)
                End If
                Return CType(curObj("Revision"), UShort)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("A free form string describing the role of the processor - for example, ""Central P" & _
            "rocessor""' or ""Math Processor""")> _
        Public ReadOnly Property Role() As String
            Get
                Return CType(curObj("Role"), String)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The SocketDesignation property contains the type of chip socket used on the circu" & _
            "it." & Global.Microsoft.VisualBasic.ChrW(10) & "Example: J202")> _
        Public ReadOnly Property SocketDesignation() As String
            Get
                Return CType(curObj("SocketDesignation"), String)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The Status property is a string indicating the current status of the object. Vari" & _
            "ous operational and non-operational statuses can be defined. Operational statuse" & _
            "s are ""OK"", ""Degraded"" and ""Pred Fail"". ""Pred Fail"" indicates that an element ma" & _
            "y be functioning properly but predicting a failure in the near future. An exampl" & _
            "e is a SMART-enabled hard drive. Non-operational statuses can also be specified." & _
            " These are ""Error"", ""Starting"", ""Stopping"" and ""Service"". The latter, ""Service""," & _
            " could apply during mirror-resilvering of a disk, reload of a user permissions l" & _
            "ist, or other administrative work. Not all such work is on-line, yet the managed" & _
            " element is neither ""OK"" nor in one of the other states.")> _
        Public ReadOnly Property Status() As String
            Get
                Return CType(curObj("Status"), String)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsStatusInfoNull() As Boolean
            Get
                If (curObj("StatusInfo") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("StatusInfo is a string indicating whether the logical device is in an enabled (va" & _
            "lue = 3), disabled (value = 4) or some other (1) or unknown (2) state. If this p" & _
            "roperty does not apply to the logical device, the value, 5 (""Not Applicable""), s" & _
            "hould be used."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property StatusInfo() As StatusInfoValues
            Get
                If (curObj("StatusInfo") Is Nothing) Then
                    Return CType(System.Convert.ToInt32(0), StatusInfoValues)
                End If
                Return CType(System.Convert.ToInt32(curObj("StatusInfo")), StatusInfoValues)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("Stepping is a free-form string indicating the revision level of the processor wit" & _
            "hin the processor family.")> _
        Public ReadOnly Property Stepping() As String
            Get
                Return CType(curObj("Stepping"), String)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The scoping System's CreationClassName.")> _
        Public ReadOnly Property SystemCreationClassName() As String
            Get
                Return CType(curObj("SystemCreationClassName"), String)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The scoping System's Name.")> _
        Public ReadOnly Property SystemName() As String
            Get
                Return CType(curObj("SystemName"), String)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("A globally unique identifier for the processor.  This identifier may only be uniq" & _
            "ue within a processor family.")> _
        Public ReadOnly Property UniqueId() As String
            Get
                Return CType(curObj("UniqueId"), String)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsUpgradeMethodNull() As Boolean
            Get
                If (curObj("UpgradeMethod") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("CPU socket information including data on how this Processor can be upgraded (if u" & _
            "pgrades are supported). This property is an integer enumeration."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property UpgradeMethod() As UpgradeMethodValues
            Get
                If (curObj("UpgradeMethod") Is Nothing) Then
                    Return CType(System.Convert.ToInt32(0), UpgradeMethodValues)
                End If
                Return CType(System.Convert.ToInt32(curObj("UpgradeMethod")), UpgradeMethodValues)
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The Version property specifies an architecture-dependent processor revision numbe" & _
            "r. Note: This member is not used in Windows 95." & Global.Microsoft.VisualBasic.ChrW(10) & "Example: Model 2, Stepping 12.")> _
        Public ReadOnly Property Version() As String
            Get
                Return CType(curObj("Version"), String)
            End Get
        End Property

        <Browsable(False), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
        Public ReadOnly Property IsVoltageCapsNull() As Boolean
            Get
                If (curObj("VoltageCaps") Is Nothing) Then
                    Return True
                Else
                    Return False
                End If
            End Get
        End Property

        <Browsable(True), _
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
         Description("The VoltageCaps property specifies the voltage capabilities of the processor. Bit" & _
            "s 0-3 of the field represent specific voltages that the processor socket can acc" & _
            "ept. All other bits should be set to zero. The socket is configurable if multipl" & _
            "e bits are being set. For a range of voltages see CurrentVoltage. If the propert" & _
            "y is NULL, then the voltage capabilities are unknown."), _
         TypeConverter(GetType(WMIValueTypeConverter))> _
        Public ReadOnly Property VoltageCaps() As VoltageCapsValues
            Get
                If (curObj("VoltageCaps") Is Nothing) Then
                    Return CType(System.Convert.ToInt32(8), VoltageCapsValues)
                End If
                Return CType(System.Convert.ToInt32(curObj("VoltageCaps")), VoltageCapsValues)
            End Get
        End Property

        Private Overloads Function CheckIfProperClass(ByVal mgmtScope As System.Management.ManagementScope, ByVal path As System.Management.ManagementPath, ByVal OptionsParam As System.Management.ObjectGetOptions) As Boolean
            If ((Not (path) Is Nothing) _
                        AndAlso (String.Compare(path.ClassName, Me.ManagementClassName, True, System.Globalization.CultureInfo.InvariantCulture) = 0)) Then
                Return True
            Else
                Return CheckIfProperClass(New System.Management.ManagementObject(mgmtScope, path, OptionsParam))
            End If
        End Function

        Private Overloads Function CheckIfProperClass(ByVal theObj As System.Management.ManagementBaseObject) As Boolean
            If ((Not (theObj) Is Nothing) _
                        AndAlso (String.Compare(CType(theObj("__CLASS"), String), Me.ManagementClassName, True, System.Globalization.CultureInfo.InvariantCulture) = 0)) Then
                Return True
            Else
                Dim parentClasses As System.Array = CType(theObj("__DERIVATION"), System.Array)
                If (Not (parentClasses) Is Nothing) Then
                    Dim count As Integer = 0
                    count = 0
                    Do While (count < parentClasses.Length)
                        If (String.Compare(CType(parentClasses.GetValue(count), String), Me.ManagementClassName, True, System.Globalization.CultureInfo.InvariantCulture) = 0) Then
                            Return True
                        End If
                        count = (count + 1)
                    Loop
                End If
            End If
            Return False
        End Function

        Private Function ShouldSerializeAddressWidth() As Boolean
            If (Me.IsAddressWidthNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeArchitecture() As Boolean
            If (Me.IsArchitectureNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeAvailability() As Boolean
            If (Me.IsAvailabilityNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeConfigManagerErrorCode() As Boolean
            If (Me.IsConfigManagerErrorCodeNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeConfigManagerUserConfig() As Boolean
            If (Me.IsConfigManagerUserConfigNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeCpuStatus() As Boolean
            If (Me.IsCpuStatusNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeCurrentClockSpeed() As Boolean
            If (Me.IsCurrentClockSpeedNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeCurrentVoltage() As Boolean
            If (Me.IsCurrentVoltageNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeDataWidth() As Boolean
            If (Me.IsDataWidthNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeErrorCleared() As Boolean
            If (Me.IsErrorClearedNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeExtClock() As Boolean
            If (Me.IsExtClockNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeFamily() As Boolean
            If (Me.IsFamilyNull = False) Then
                Return True
            End If
            Return False
        End Function

        'Converts a given datetime in DMTF format to System.DateTime object.
        Shared Function ToDateTime(ByVal dmtfDate As String) As Date
            Dim initializer As Date = Date.MinValue
            Dim year As Integer = initializer.Year
            Dim month As Integer = initializer.Month
            Dim day As Integer = initializer.Day
            Dim hour As Integer = initializer.Hour
            Dim minute As Integer = initializer.Minute
            Dim second As Integer = initializer.Second
            Dim ticks As Long = 0
            Dim dmtf As String = dmtfDate
            Dim datetime As Date = Date.MinValue
            Dim tempString As String = String.Empty
            If (dmtf Is Nothing) Then
                Throw New System.ArgumentOutOfRangeException
            End If
            If (dmtf.Length = 0) Then
                Throw New System.ArgumentOutOfRangeException
            End If
            If (dmtf.Length <> 25) Then
                Throw New System.ArgumentOutOfRangeException
            End If
            Try
                tempString = dmtf.Substring(0, 4)
                If ("****" <> tempString) Then
                    year = Integer.Parse(tempString)
                End If
                tempString = dmtf.Substring(4, 2)
                If ("**" <> tempString) Then
                    month = Integer.Parse(tempString)
                End If
                tempString = dmtf.Substring(6, 2)
                If ("**" <> tempString) Then
                    day = Integer.Parse(tempString)
                End If
                tempString = dmtf.Substring(8, 2)
                If ("**" <> tempString) Then
                    hour = Integer.Parse(tempString)
                End If
                tempString = dmtf.Substring(10, 2)
                If ("**" <> tempString) Then
                    minute = Integer.Parse(tempString)
                End If
                tempString = dmtf.Substring(12, 2)
                If ("**" <> tempString) Then
                    second = Integer.Parse(tempString)
                End If
                tempString = dmtf.Substring(15, 6)
                If ("******" <> tempString) Then
                    ticks = (Long.Parse(tempString) * CType((System.TimeSpan.TicksPerMillisecond / 1000), Long))
                End If
                If ((((((((year < 0) _
                            OrElse (month < 0)) _
                            OrElse (day < 0)) _
                            OrElse (hour < 0)) _
                            OrElse (minute < 0)) _
                            OrElse (minute < 0)) _
                            OrElse (second < 0)) _
                            OrElse (ticks < 0)) Then
                    Throw New System.ArgumentOutOfRangeException
                End If
            Catch e As System.Exception
                Throw New System.ArgumentOutOfRangeException(Nothing, e.Message)
            End Try
            datetime = New Date(year, month, day, hour, minute, second, 0)
            datetime = datetime.AddTicks(ticks)
            Dim tickOffset As System.TimeSpan = System.TimeZone.CurrentTimeZone.GetUtcOffset(datetime)
            Dim UTCOffset As Integer = 0
            Dim OffsetToBeAdjusted As Integer = 0
            Dim OffsetMins As Long = CType((tickOffset.Ticks / System.TimeSpan.TicksPerMinute), Long)
            tempString = dmtf.Substring(22, 3)
            If (tempString <> "******") Then
                tempString = dmtf.Substring(21, 4)
                Try
                    UTCOffset = Integer.Parse(tempString)
                Catch e As System.Exception
                    Throw New System.ArgumentOutOfRangeException(Nothing, e.Message)
                End Try
                OffsetToBeAdjusted = CType((OffsetMins - UTCOffset), Integer)
                datetime = datetime.AddMinutes(CType(OffsetToBeAdjusted, Double))
            End If
            Return datetime
        End Function

        'Converts a given System.DateTime object to DMTF datetime format.
        Shared Function ToDmtfDateTime(ByVal [date] As Date) As String
            Dim utcString As String = String.Empty
            Dim tickOffset As System.TimeSpan = System.TimeZone.CurrentTimeZone.GetUtcOffset([date])
            Dim OffsetMins As Long = CType((tickOffset.Ticks / System.TimeSpan.TicksPerMinute), Long)
            If (System.Math.Abs(OffsetMins) > 999) Then
                [date] = [date].ToUniversalTime
                utcString = "+000"
            Else
                If (tickOffset.Ticks >= 0) Then
                    utcString = String.Concat("+", CType((tickOffset.Ticks / System.TimeSpan.TicksPerMinute), System.Int64).ToString.PadLeft(3, Global.Microsoft.VisualBasic.ChrW(48)))
                Else
                    Dim strTemp As String = CType(OffsetMins, System.Int64).ToString
                    utcString = String.Concat("-", strTemp.Substring(1, (strTemp.Length - 1)).PadLeft(3, Global.Microsoft.VisualBasic.ChrW(48)))
                End If
            End If
            Dim dmtfDateTime As String = CType([date].Year, System.Int32).ToString.PadLeft(4, Global.Microsoft.VisualBasic.ChrW(48))
            dmtfDateTime = String.Concat(dmtfDateTime, CType([date].Month, System.Int32).ToString.PadLeft(2, Global.Microsoft.VisualBasic.ChrW(48)))
            dmtfDateTime = String.Concat(dmtfDateTime, CType([date].Day, System.Int32).ToString.PadLeft(2, Global.Microsoft.VisualBasic.ChrW(48)))
            dmtfDateTime = String.Concat(dmtfDateTime, CType([date].Hour, System.Int32).ToString.PadLeft(2, Global.Microsoft.VisualBasic.ChrW(48)))
            dmtfDateTime = String.Concat(dmtfDateTime, CType([date].Minute, System.Int32).ToString.PadLeft(2, Global.Microsoft.VisualBasic.ChrW(48)))
            dmtfDateTime = String.Concat(dmtfDateTime, CType([date].Second, System.Int32).ToString.PadLeft(2, Global.Microsoft.VisualBasic.ChrW(48)))
            dmtfDateTime = String.Concat(dmtfDateTime, ".")
            Dim dtTemp As Date = New Date([date].Year, [date].Month, [date].Day, [date].Hour, [date].Minute, [date].Second, 0)
            Dim microsec As Long = CType(((([date].Ticks - dtTemp.Ticks) _
                        * 1000) _
                        / System.TimeSpan.TicksPerMillisecond), Long)
            Dim strMicrosec As String = CType(microsec, System.Int64).ToString
            If (strMicrosec.Length > 6) Then
                strMicrosec = strMicrosec.Substring(0, 6)
            End If
            dmtfDateTime = String.Concat(dmtfDateTime, strMicrosec.PadLeft(6, Global.Microsoft.VisualBasic.ChrW(48)))
            dmtfDateTime = String.Concat(dmtfDateTime, utcString)
            Return dmtfDateTime
        End Function

        Private Function ShouldSerializeInstallDate() As Boolean
            If (Me.IsInstallDateNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeL2CacheSize() As Boolean
            If (Me.IsL2CacheSizeNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeL2CacheSpeed() As Boolean
            If (Me.IsL2CacheSpeedNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeL3CacheSize() As Boolean
            If (Me.IsL3CacheSizeNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeL3CacheSpeed() As Boolean
            If (Me.IsL3CacheSpeedNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeLastErrorCode() As Boolean
            If (Me.IsLastErrorCodeNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeLevel() As Boolean
            If (Me.IsLevelNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeLoadPercentage() As Boolean
            If (Me.IsLoadPercentageNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeMaxClockSpeed() As Boolean
            If (Me.IsMaxClockSpeedNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeNumberOfCores() As Boolean
            If (Me.IsNumberOfCoresNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeNumberOfLogicalProcessors() As Boolean
            If (Me.IsNumberOfLogicalProcessorsNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializePowerManagementSupported() As Boolean
            If (Me.IsPowerManagementSupportedNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeProcessorType() As Boolean
            If (Me.IsProcessorTypeNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeRevision() As Boolean
            If (Me.IsRevisionNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeStatusInfo() As Boolean
            If (Me.IsStatusInfoNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeUpgradeMethod() As Boolean
            If (Me.IsUpgradeMethodNull = False) Then
                Return True
            End If
            Return False
        End Function

        Private Function ShouldSerializeVoltageCaps() As Boolean
            If (Me.IsVoltageCapsNull = False) Then
                Return True
            End If
            Return False
        End Function

        <Browsable(True)> _
        Public Overloads Sub CommitObject()
            If (isEmbedded = False) Then
                PrivateLateBoundObject.Put()
            End If
        End Sub

        <Browsable(True)> _
        Public Overloads Sub CommitObject(ByVal putOptions As System.Management.PutOptions)
            If (isEmbedded = False) Then
                PrivateLateBoundObject.Put(putOptions)
            End If
        End Sub

        Private Sub Initialize()
            AutoCommitProp = True
            isEmbedded = False
        End Sub

        Private Shared Function ConstructPath(ByVal keyDeviceID As String) As String
            Dim strPath As String = "root\cimv2:Win32_Processor"
            strPath = String.Concat(strPath, String.Concat(".DeviceID=", String.Concat("""", String.Concat(keyDeviceID, """"))))
            Return strPath
        End Function

        Private Sub InitializeObject(ByVal mgmtScope As System.Management.ManagementScope, ByVal path As System.Management.ManagementPath, ByVal getOptions As System.Management.ObjectGetOptions)
            Initialize()
            If (Not (path) Is Nothing) Then
                If (CheckIfProperClass(mgmtScope, path, getOptions) <> True) Then
                    Throw New System.ArgumentException("Class name does not match.")
                End If
            End If
            PrivateLateBoundObject = New System.Management.ManagementObject(mgmtScope, path, getOptions)
            PrivateSystemProperties = New ManagementSystemProperties(PrivateLateBoundObject)
            curObj = PrivateLateBoundObject
        End Sub

        'Different overloads of GetInstances() help in enumerating instances of the WMI class.
        Public Overloads Shared Function GetInstances() As ProcessorCollection
            Return GetInstances(Nothing, Nothing, Nothing)
        End Function

        Public Overloads Shared Function GetInstances(ByVal condition As String) As ProcessorCollection
            Return GetInstances(Nothing, condition, Nothing)
        End Function

        Public Overloads Shared Function GetInstances(ByVal selectedProperties() As System.String) As ProcessorCollection
            Return GetInstances(Nothing, Nothing, selectedProperties)
        End Function

        Public Overloads Shared Function GetInstances(ByVal condition As String, ByVal selectedProperties() As System.String) As ProcessorCollection
            Return GetInstances(Nothing, condition, selectedProperties)
        End Function

        Public Overloads Shared Function GetInstances(ByVal mgmtScope As System.Management.ManagementScope, ByVal enumOptions As System.Management.EnumerationOptions) As ProcessorCollection
            If (mgmtScope Is Nothing) Then
                If (statMgmtScope Is Nothing) Then
                    mgmtScope = New System.Management.ManagementScope
                    mgmtScope.Path.NamespacePath = "root\cimv2"
                Else
                    mgmtScope = statMgmtScope
                End If
            End If
            Dim pathObj As System.Management.ManagementPath = New System.Management.ManagementPath
            pathObj.ClassName = "Win32_Processor"
            pathObj.NamespacePath = "root\cimv2"
            Dim clsObject As System.Management.ManagementClass = New System.Management.ManagementClass(mgmtScope, pathObj, Nothing)
            If (enumOptions Is Nothing) Then
                enumOptions = New System.Management.EnumerationOptions
                enumOptions.EnsureLocatable = True
            End If
            Return New ProcessorCollection(clsObject.GetInstances(enumOptions))
        End Function

        Public Overloads Shared Function GetInstances(ByVal mgmtScope As System.Management.ManagementScope, ByVal condition As String) As ProcessorCollection
            Return GetInstances(mgmtScope, condition, Nothing)
        End Function

        Public Overloads Shared Function GetInstances(ByVal mgmtScope As System.Management.ManagementScope, ByVal selectedProperties() As System.String) As ProcessorCollection
            Return GetInstances(mgmtScope, Nothing, selectedProperties)
        End Function

        Public Overloads Shared Function GetInstances(ByVal mgmtScope As System.Management.ManagementScope, ByVal condition As String, ByVal selectedProperties() As System.String) As ProcessorCollection
            If (mgmtScope Is Nothing) Then
                If (statMgmtScope Is Nothing) Then
                    mgmtScope = New System.Management.ManagementScope
                    mgmtScope.Path.NamespacePath = "root\cimv2"
                Else
                    mgmtScope = statMgmtScope
                End If
            End If
            Dim ObjectSearcher As System.Management.ManagementObjectSearcher = New System.Management.ManagementObjectSearcher(mgmtScope, New SelectQuery("Win32_Processor", condition, selectedProperties))
            Dim enumOptions As System.Management.EnumerationOptions = New System.Management.EnumerationOptions
            enumOptions.EnsureLocatable = True
            ObjectSearcher.Options = enumOptions
            Return New ProcessorCollection(ObjectSearcher.Get)
        End Function

        <Browsable(True)> _
        Public Shared Function CreateInstance() As Processor
            Dim mgmtScope As System.Management.ManagementScope = Nothing
            If (statMgmtScope Is Nothing) Then
                mgmtScope = New System.Management.ManagementScope
                mgmtScope.Path.NamespacePath = CreatedWmiNamespace
            Else
                mgmtScope = statMgmtScope
            End If
            Dim mgmtPath As System.Management.ManagementPath = New System.Management.ManagementPath(CreatedClassName)
            Dim tmpMgmtClass As System.Management.ManagementClass = New System.Management.ManagementClass(mgmtScope, mgmtPath, Nothing)
            Return New Processor(tmpMgmtClass.CreateInstance)
        End Function

        <Browsable(True)> _
        Public Sub Delete()
            PrivateLateBoundObject.Delete()
        End Sub

        Public Function Reset() As UInteger
            If (isEmbedded = False) Then
                Dim inParams As System.Management.ManagementBaseObject = Nothing
                Dim outParams As System.Management.ManagementBaseObject = PrivateLateBoundObject.InvokeMethod("Reset", inParams, Nothing)
                Return System.Convert.ToUInt32(outParams.Properties("ReturnValue").Value)
            Else
                Return System.Convert.ToUInt32(0)
            End If
        End Function

        Public Function SetPowerState(ByVal PowerState As UShort, ByVal Time As Date) As UInteger
            If (isEmbedded = False) Then
                Dim inParams As System.Management.ManagementBaseObject = Nothing
                inParams = PrivateLateBoundObject.GetMethodParameters("SetPowerState")
                inParams("PowerState") = CType(PowerState, System.UInt16)
                inParams("Time") = ToDmtfDateTime(CType(Time, Date))
                Dim outParams As System.Management.ManagementBaseObject = PrivateLateBoundObject.InvokeMethod("SetPowerState", inParams, Nothing)
                Return System.Convert.ToUInt32(outParams.Properties("ReturnValue").Value)
            Else
                Return System.Convert.ToUInt32(0)
            End If
        End Function

        Public Enum ArchitectureValues

            X86 = 0

            MIPS = 1

            Alpha = 2

            PowerPC = 3

            Ia64 = 6

            X64 = 9

            NULL_ENUM_VALUE = 10
        End Enum

        Public Enum AvailabilityValues

            Other0 = 1

            Unknown0 = 2

            Running_Full_Power = 3

            Warning = 4

            In_Test = 5

            Not_Applicable = 6

            Power_Off = 7

            Off_Line = 8

            Off_Duty = 9

            Degraded = 10

            Not_Installed = 11

            Install_Error = 12

            Power_Save_Unknown = 13

            Power_Save_Low_Power_Mode = 14

            Power_Save_Standby = 15

            Power_Cycle = 16

            Power_Save_Warning = 17

            Paused = 18

            Not_Ready = 19

            Not_Configured = 20

            Quiesced = 21

            NULL_ENUM_VALUE = 0
        End Enum

        Public Enum ConfigManagerErrorCodeValues

            This_device_is_working_properly_ = 0

            This_device_is_not_configured_correctly_ = 1

            Windows_cannot_load_the_driver_for_this_device_ = 2

            The_driver_for_this_device_might_be_corrupted_or_your_system_may_be_running_low_on_memory_or_other_resources_ = 3

            This_device_is_not_working_properly_One_of_its_drivers_or_your_registry_might_be_corrupted_ = 4

            The_driver_for_this_device_needs_a_resource_that_Windows_cannot_manage_ = 5

            The_boot_configuration_for_this_device_conflicts_with_other_devices_ = 6

            Cannot_filter_ = 7

            The_driver_loader_for_the_device_is_missing_ = 8

            This_device_is_not_working_properly_because_the_controlling_firmware_is_reporting_the_resources_for_the_device_incorrectly_ = 9

            This_device_cannot_start_ = 10

            This_device_failed_ = 11

            This_device_cannot_find_enough_free_resources_that_it_can_use_ = 12

            Windows_cannot_verify_this_device_s_resources_ = 13

            This_device_cannot_work_properly_until_you_restart_your_computer_ = 14

            This_device_is_not_working_properly_because_there_is_probably_a_re_enumeration_problem_ = 15

            Windows_cannot_identify_all_the_resources_this_device_uses_ = 16

            This_device_is_asking_for_an_unknown_resource_type_ = 17

            Reinstall_the_drivers_for_this_device_ = 18

            Failure_using_the_VxD_loader_ = 19

            Your_registry_might_be_corrupted_ = 20

            System_failure_Try_changing_the_driver_for_this_device_If_that_does_not_work_see_your_hardware_documentation_Windows_is_removing_this_device_ = 21

            This_device_is_disabled_ = 22

            System_failure_Try_changing_the_driver_for_this_device_If_that_doesn_t_work_see_your_hardware_documentation_ = 23

            This_device_is_not_present_is_not_working_properly_or_does_not_have_all_its_drivers_installed_ = 24

            Windows_is_still_setting_up_this_device_ = 25

            Windows_is_still_setting_up_this_device_0 = 26

            This_device_does_not_have_valid_log_configuration_ = 27

            The_drivers_for_this_device_are_not_installed_ = 28

            This_device_is_disabled_because_the_firmware_of_the_device_did_not_give_it_the_required_resources_ = 29

            This_device_is_using_an_Interrupt_Request_IRQ_resource_that_another_device_is_using_ = 30

            This_device_is_not_working_properly_because_Windows_cannot_load_the_drivers_required_for_this_device_ = 31

            NULL_ENUM_VALUE = 32
        End Enum

        Public Enum CpuStatusValues

            Unknown0 = 0

            CPU_Enabled = 1

            CPU_Disabled_by_User_via_BIOS_Setup = 2

            CPU_Disabled_By_BIOS_POST_Error_ = 3

            CPU_is_Idle = 4

            Reserved = 5

            Reserved0 = 6

            Other0 = 7

            NULL_ENUM_VALUE = 8
        End Enum

        Public Enum FamilyValues

            Other0 = 1

            Unknown0 = 2

            Val_8086 = 3

            Val_80286 = 4

            Val_80386 = 5

            Val_80486 = 6

            Val_8087 = 7

            Val_80287 = 8

            Val_80387 = 9

            Val_80487 = 10

            Pentium_R_brand = 11

            Pentium_R_Pro = 12

            Pentium_R_II = 13

            Pentium_R_processor_with_MMX_TM_technology = 14

            Celeron_TM_ = 15

            Pentium_R_II_Xeon_TM_ = 16

            Pentium_R_III = 17

            M1_Family = 18

            M2_Family = 19

            K5_Family = 24

            K6_Family = 25

            K6_2 = 26

            K6_3 = 27

            AMD_Athlon_TM_Processor_Family = 28

            AMD_R_Duron_TM_Processor = 29

            AMD29000_Family = 30

            K6_2_ = 31

            Power_PC_Family = 32

            Power_PC_601 = 33

            Power_PC_603 = 34

            Power_PC_603_ = 35

            Power_PC_604 = 36

            Power_PC_620 = 37

            Power_PC_X704 = 38

            Power_PC_750 = 39

            Alpha_Family = 48

            Alpha_21064 = 49

            Alpha_21066 = 50

            Alpha_21164 = 51

            Alpha_21164PC = 52

            Alpha_21164a = 53

            Alpha_21264 = 54

            Alpha_21364 = 55

            MIPS_Family = 64

            MIPS_R4000 = 65

            MIPS_R4200 = 66

            MIPS_R4400 = 67

            MIPS_R4600 = 68

            MIPS_R10000 = 69

            SPARC_Family = 80

            SuperSPARC = 81

            MicroSPARC_II = 82

            MicroSPARC_IIep = 83

            UltraSPARC = 84

            UltraSPARC_II = 85

            UltraSPARC_IIi = 86

            UltraSPARC_III0 = 87

            UltraSPARC_IIIi = 88

            Val_68040 = 96

            Val_68xxx_Family = 97

            Val_68000 = 98

            Val_68010 = 99

            Val_68020 = 100

            Val_68030 = 101

            Hobbit_Family = 112

            Crusoe_TM_TM5000_Family = 120

            Crusoe_TM_TM3000_Family = 121

            Efficeon_TM_TM8000_Family = 122

            Weitek = 128

            Itanium_TM_Processor = 130

            AMD_Athlon_TM_64_Processor_Family = 131

            AMD_Opteron_TM_Family = 132

            PA_RISC_Family = 144

            PA_RISC_8500 = 145

            PA_RISC_8000 = 146

            PA_RISC_7300LC = 147

            PA_RISC_7200 = 148

            PA_RISC_7100LC = 149

            PA_RISC_7100 = 150

            V30_Family = 160

            Pentium_R_III_Xeon_TM_ = 176

            Pentium_R_III_Processor_with_Intel_R_SpeedStep_TM_Technology = 177

            Pentium_R_4 = 178

            Intel_R_Xeon_TM_ = 179

            AS400_Family = 180

            Intel_R_Xeon_TM_processor_MP = 181

            AMD_AthlonXP_TM_Family = 182

            AMD_AthlonMP_TM_Family = 183

            Intel_R_Itanium_R_2 = 184

            Intel_Pentium_M_Processor = 185

            K7 = 190

            IBM390_Family = 200

            G4 = 201

            G5 = 202

            G6 = 203

            Z_Architecture_base = 204

            I860 = 250

            I960 = 251

            SH_3 = 260

            SH_4 = 261

            ARM = 280

            StrongARM = 281

            Val_6x86 = 300

            MediaGX = 301

            MII = 302

            WinChip = 320

            DSP = 350

            Video_Processor = 500

            NULL_ENUM_VALUE = 0
        End Enum

        Public Enum PowerManagementCapabilitiesValues

            Unknown0 = 0

            Not_Supported = 1

            Disabled = 2

            Enabled = 3

            Power_Saving_Modes_Entered_Automatically = 4

            Power_State_Settable = 5

            Power_Cycling_Supported = 6

            Timed_Power_On_Supported = 7

            NULL_ENUM_VALUE = 8
        End Enum

        Public Enum ProcessorTypeValues

            Other0 = 1

            Unknown0 = 2

            Central_Processor = 3

            Math_Processor = 4

            DSP_Processor = 5

            Video_Processor = 6

            NULL_ENUM_VALUE = 0
        End Enum

        Public Enum StatusInfoValues

            Other0 = 1

            Unknown0 = 2

            Enabled = 3

            Disabled = 4

            Not_Applicable = 5

            NULL_ENUM_VALUE = 0
        End Enum

        Public Enum UpgradeMethodValues

            Other0 = 1

            Unknown0 = 2

            Daughter_Board = 3

            ZIF_Socket = 4

            Replacement_Piggy_Back = 5

            None = 6

            LIF_Socket = 7

            Slot_1 = 8

            Slot_2 = 9

            Val_370_Pin_Socket = 10

            Slot_A = 11

            Slot_M = 12

            Socket_423 = 13

            Socket_A_Socket_462_ = 14

            Socket_478 = 15

            Socket_754 = 16

            Socket_940 = 17

            Socket_939 = 18

            NULL_ENUM_VALUE = 0
        End Enum

        Public Enum VoltageCapsValues

            Val_5 = 1

            Val_3_3 = 2

            Val_2_9 = 4

            NULL_ENUM_VALUE = 8
        End Enum

        'Enumerator implementation for enumerating instances of the class.
        Public Class ProcessorCollection
            Inherits Object
            Implements ICollection

            Private privColObj As ManagementObjectCollection

            Public Sub New(ByVal objCollection As ManagementObjectCollection)
                MyBase.New()
                privColObj = objCollection
            End Sub

            Public Overridable ReadOnly Property Count() As Integer Implements System.Collections.ICollection.Count
                Get
                    Return privColObj.Count
                End Get
            End Property

            Public Overridable ReadOnly Property IsSynchronized() As Boolean Implements System.Collections.ICollection.IsSynchronized
                Get
                    Return privColObj.IsSynchronized
                End Get
            End Property

            Public Overridable ReadOnly Property SyncRoot() As Object Implements System.Collections.ICollection.SyncRoot
                Get
                    Return Me
                End Get
            End Property

            Public Overridable Sub CopyTo(ByVal array As System.Array, ByVal index As Integer) Implements System.Collections.ICollection.CopyTo
                privColObj.CopyTo(array, index)
                Dim nCtr As Integer
                nCtr = 0
                Do While (nCtr < array.Length)
                    array.SetValue(New Processor(CType(array.GetValue(nCtr), System.Management.ManagementObject)), nCtr)
                    nCtr = (nCtr + 1)
                Loop
            End Sub

            Public Overridable Function GetEnumerator() As System.Collections.IEnumerator Implements System.Collections.IEnumerable.GetEnumerator
                Return New ProcessorEnumerator(privColObj.GetEnumerator)
            End Function

            Public Class ProcessorEnumerator
                Inherits Object
                Implements System.Collections.IEnumerator

                Private privObjEnum As ManagementObjectCollection.ManagementObjectEnumerator

                Public Sub New(ByVal objEnum As ManagementObjectCollection.ManagementObjectEnumerator)
                    MyBase.New()
                    privObjEnum = objEnum
                End Sub

                Public Overridable ReadOnly Property Current() As Object Implements System.Collections.IEnumerator.Current
                    Get
                        Return New Processor(CType(privObjEnum.Current, System.Management.ManagementObject))
                    End Get
                End Property

                Public Overridable Function MoveNext() As Boolean Implements System.Collections.IEnumerator.MoveNext
                    Return privObjEnum.MoveNext
                End Function

                Public Overridable Sub Reset() Implements System.Collections.IEnumerator.Reset
                    privObjEnum.Reset()
                End Sub
            End Class
        End Class

        'TypeConverter to handle null values for ValueType properties
        Public Class WMIValueTypeConverter
            Inherits TypeConverter

            Private baseConverter As TypeConverter

            Private baseType As System.Type

            Public Sub New(ByVal inBaseType As System.Type)
                MyBase.New()
                baseConverter = TypeDescriptor.GetConverter(inBaseType)
                baseType = inBaseType
            End Sub

            Public Overloads Overrides Function CanConvertFrom(ByVal context As System.ComponentModel.ITypeDescriptorContext, ByVal srcType As System.Type) As Boolean
                Return baseConverter.CanConvertFrom(context, srcType)
            End Function

            Public Overloads Overrides Function CanConvertTo(ByVal context As System.ComponentModel.ITypeDescriptorContext, ByVal destinationType As System.Type) As Boolean
                Return baseConverter.CanConvertTo(context, destinationType)
            End Function

            Public Overloads Overrides Function ConvertFrom(ByVal context As System.ComponentModel.ITypeDescriptorContext, ByVal culture As System.Globalization.CultureInfo, ByVal value As Object) As Object
                Return baseConverter.ConvertFrom(context, culture, value)
            End Function

            Public Overloads Overrides Function CreateInstance(ByVal context As System.ComponentModel.ITypeDescriptorContext, ByVal dictionary As System.Collections.IDictionary) As Object
                Return baseConverter.CreateInstance(context, dictionary)
            End Function

            Public Overloads Overrides Function GetCreateInstanceSupported(ByVal context As System.ComponentModel.ITypeDescriptorContext) As Boolean
                Return baseConverter.GetCreateInstanceSupported(context)
            End Function

            Public Overloads Overrides Function GetProperties(ByVal context As System.ComponentModel.ITypeDescriptorContext, ByVal value As Object, ByVal attributeVar() As System.Attribute) As PropertyDescriptorCollection
                Return baseConverter.GetProperties(context, value, attributeVar)
            End Function

            Public Overloads Overrides Function GetPropertiesSupported(ByVal context As System.ComponentModel.ITypeDescriptorContext) As Boolean
                Return baseConverter.GetPropertiesSupported(context)
            End Function

            Public Overloads Overrides Function GetStandardValues(ByVal context As System.ComponentModel.ITypeDescriptorContext) As System.ComponentModel.TypeConverter.StandardValuesCollection
                Return baseConverter.GetStandardValues(context)
            End Function

            Public Overloads Overrides Function GetStandardValuesExclusive(ByVal context As System.ComponentModel.ITypeDescriptorContext) As Boolean
                Return baseConverter.GetStandardValuesExclusive(context)
            End Function

            Public Overloads Overrides Function GetStandardValuesSupported(ByVal context As System.ComponentModel.ITypeDescriptorContext) As Boolean
                Return baseConverter.GetStandardValuesSupported(context)
            End Function

            Public Overloads Overrides Function ConvertTo(ByVal context As System.ComponentModel.ITypeDescriptorContext, ByVal culture As System.Globalization.CultureInfo, ByVal value As Object, ByVal destinationType As System.Type) As Object
                If (baseType.BaseType Is GetType(System.[Enum])) Then
                    If (value.GetType Is destinationType) Then
                        Return value
                    End If
                    If (((value = Nothing) _
                                AndAlso (Not (context) Is Nothing)) _
                                AndAlso (context.PropertyDescriptor.ShouldSerializeValue(context.Instance) = False)) Then
                        Return "NULL_ENUM_VALUE"
                    End If
                    Return baseConverter.ConvertTo(context, culture, value, destinationType)
                End If
                If ((baseType Is GetType(Boolean)) _
                            AndAlso (baseType.BaseType Is GetType(System.ValueType))) Then
                    If (((value = Nothing) _
                                AndAlso (Not (context) Is Nothing)) _
                                AndAlso (context.PropertyDescriptor.ShouldSerializeValue(context.Instance) = False)) Then
                        Return ""
                    End If
                    Return baseConverter.ConvertTo(context, culture, value, destinationType)
                End If
                If ((Not (context) Is Nothing) _
                            AndAlso (context.PropertyDescriptor.ShouldSerializeValue(context.Instance) = False)) Then
                    Return ""
                End If
                Return baseConverter.ConvertTo(context, culture, value, destinationType)
            End Function
        End Class

        'Embedded class to represent WMI system Properties.
        <TypeConverter(GetType(System.ComponentModel.ExpandableObjectConverter))> _
        Public Class ManagementSystemProperties

            Private PrivateLateBoundObject As System.Management.ManagementBaseObject

            Public Sub New(ByVal ManagedObject As System.Management.ManagementBaseObject)
                MyBase.New()
                PrivateLateBoundObject = ManagedObject
            End Sub

            <Browsable(True)> _
            Public ReadOnly Property GENUS() As Integer
                Get
                    Return CType(PrivateLateBoundObject("__GENUS"), Integer)
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property [CLASS]() As String
                Get
                    Return CType(PrivateLateBoundObject("__CLASS"), String)
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property SUPERCLASS() As String
                Get
                    Return CType(PrivateLateBoundObject("__SUPERCLASS"), String)
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property DYNASTY() As String
                Get
                    Return CType(PrivateLateBoundObject("__DYNASTY"), String)
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property RELPATH() As String
                Get
                    Return CType(PrivateLateBoundObject("__RELPATH"), String)
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property PROPERTY_COUNT() As Integer
                Get
                    Return CType(PrivateLateBoundObject("__PROPERTY_COUNT"), Integer)
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property DERIVATION() As String()
                Get
                    Return CType(PrivateLateBoundObject("__DERIVATION"), String())
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property SERVER() As String
                Get
                    Return CType(PrivateLateBoundObject("__SERVER"), String)
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property [NAMESPACE]() As String
                Get
                    Return CType(PrivateLateBoundObject("__NAMESPACE"), String)
                End Get
            End Property

            <Browsable(True)> _
            Public ReadOnly Property PATH() As String
                Get
                    Return CType(PrivateLateBoundObject("__PATH"), String)
                End Get
            End Property
        End Class
    End Class

#End Region




End Class
